comparison Makefile.in @ 1559:92c93b4a3646 fuzz

Fix to be able to compile normal(ish) binaries with --enable-fuzz
author Matt Johnston <matt@ucc.asn.au>
date Wed, 28 Feb 2018 22:02:12 +0800
parents 61a793b6e471
children b66fc351f7e8
comparison
equal deleted inserted replaced
1558:2f64cb3d3007 1559:92c93b4a3646
59 CONVERTOBJS=dropbearconvert.o keyimport.o 59 CONVERTOBJS=dropbearconvert.o keyimport.o
60 60
61 SCPOBJS=scp.o progressmeter.o atomicio.o scpmisc.o compat.o 61 SCPOBJS=scp.o progressmeter.o atomicio.o scpmisc.o compat.o
62 62
63 ifeq (@DROPBEAR_FUZZ@, 1) 63 ifeq (@DROPBEAR_FUZZ@, 1)
64 COMMONOBJS += fuzz-common.o fuzz-wrapfd.o 64 allobjs = $(COMMONOBJS) fuzz-common.o fuzz-wrapfd.o $(CLISVROBJS) $(CLIOBJS) $(SVROBJS)
65 endif 65 allobjs:=$(subst svr-main.o, ,$(allobjs))
66 66 allobjs:=$(subst cli-main.o, ,$(allobjs))
67 dropbearobjs=$(COMMONOBJS) $(CLISVROBJS) $(SVROBJS) 67 allobjs:=$(sort $(allobjs))
68 dbclientobjs=$(COMMONOBJS) $(CLISVROBJS) $(CLIOBJS) 68
69 dropbearkeyobjs=$(COMMONOBJS) $(KEYOBJS) 69 dropbearobjs=$(allobjs) svr-main.o
70 dropbearconvertobjs=$(COMMONOBJS) $(CONVERTOBJS) 70 dbclientobjs=$(allobjs) cli-main.o
71 scpobjs=$(SCPOBJS) 71 dropbearkeyobjs=$(allobjs) $(KEYOBJS)
72 dropbearconvertobjs=$(allobjs) $(CONVERTOBJS)
73 else
74 dropbearobjs=$(COMMONOBJS) $(CLISVROBJS) $(SVROBJS)
75 dbclientobjs=$(COMMONOBJS) $(CLISVROBJS) $(CLIOBJS)
76 dropbearkeyobjs=$(COMMONOBJS) $(KEYOBJS)
77 dropbearconvertobjs=$(COMMONOBJS) $(CONVERTOBJS)
78 scpobjs=$(SCPOBJS)
79 endif
72 80
73 VPATH=@srcdir@ 81 VPATH=@srcdir@
74 srcdir=@srcdir@ 82 srcdir=@srcdir@
75 83
76 prefix=@prefix@ 84 prefix=@prefix@
183 191
184 dbclient: $(HEADERS) $(LIBTOM_DEPS) Makefile 192 dbclient: $(HEADERS) $(LIBTOM_DEPS) Makefile
185 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS) $(LIBS) 193 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS) $(LIBS)
186 194
187 dropbearkey dropbearconvert: $(HEADERS) $(LIBTOM_DEPS) Makefile 195 dropbearkey dropbearconvert: $(HEADERS) $(LIBTOM_DEPS) Makefile
188 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS) 196 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS) $(LIBS)
189 197
190 # scp doesn't use the libs so is special. 198 # scp doesn't use the libs so is special.
191 scp: $(SCPOBJS) $(HEADERS) Makefile 199 scp: $(SCPOBJS) $(HEADERS) Makefile
192 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $(SCPOBJS) 200 $(CC) $(LDFLAGS) -o $@$(EXEEXT) $(SCPOBJS)
193 201
258 266
259 # exclude svr-main.o to avoid duplicate main 267 # exclude svr-main.o to avoid duplicate main
260 svrfuzzobjs=$(subst svr-main.o, ,$(dropbearobjs)) 268 svrfuzzobjs=$(subst svr-main.o, ,$(dropbearobjs))
261 269
262 # build all the fuzzers. This will require fail to link unless built with 270 # build all the fuzzers. This will require fail to link unless built with
263 # make fuzzers LIBS=-lFuzzer.a 271 # make fuzz-targetsk FUZZLIB=-lFuzzer.a
264 # or similar - the library provides main(). 272 # or similar - the library provides main().
265 fuzz-targets: $(FUZZ_TARGETS) $(FUZZER_OPTIONS) 273 fuzz-targets: $(FUZZ_TARGETS) $(FUZZER_OPTIONS)
266 274
267 fuzzer-preauth: fuzzer-preauth.o $(HEADERS) $(LIBTOM_DEPS) Makefile $(svrfuzzobjs) 275 fuzzer-preauth: fuzzer-preauth.o $(HEADERS) $(LIBTOM_DEPS) Makefile $(svrfuzzobjs)
268 $(CXX) $(CXXFLAGS) [email protected] $(LDFLAGS) $(svrfuzzobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@ 276 $(CXX) $(CXXFLAGS) [email protected] $(LDFLAGS) $(svrfuzzobjs) -o $@$(EXEEXT) $(LIBTOM_LIBS) $(LIBS) $(FUZZLIB) @CRYPTLIB@