comparison Makefile.in @ 1521:198e2ee0f4b1

- Fix dependencies and remove old default_options.h from version control - Rename default_options.h.in -> default_options.h, and default_options.h -> default_options_guard.h - Fix newlines in default_options.h
author Matt Johnston <matt@ucc.asn.au>
date Mon, 19 Feb 2018 22:16:50 +0800
parents 2d450c1056e3
children bb8eaa26bc93 5212630893ab
comparison
equal deleted inserted replaced
1520:84578193ef47 1521:198e2ee0f4b1
21 LIBTOM_DEPS=$(STATIC_LTC) $(STATIC_LTM) 21 LIBTOM_DEPS=$(STATIC_LTC) $(STATIC_LTM)
22 CFLAGS+=-I$(srcdir)/libtomcrypt/src/headers/ 22 CFLAGS+=-I$(srcdir)/libtomcrypt/src/headers/
23 LIBTOM_LIBS=$(STATIC_LTC) $(STATIC_LTM) 23 LIBTOM_LIBS=$(STATIC_LTC) $(STATIC_LTM)
24 endif 24 endif
25 25
26 OPTION_HEADERS = default_options_guard.h sysoptions.h
26 ifneq ($(wildcard localoptions.h),) 27 ifneq ($(wildcard localoptions.h),)
27 CFLAGS+=-DLOCALOPTIONS_H_EXISTS 28 CFLAGS+=-DLOCALOPTIONS_H_EXISTS
28 LOCALOPTIONS_H=localoptions.h 29 OPTION_HEADERS += localoptions.h
29 endif 30 endif
30 31
31 COMMONOBJS=dbutil.o buffer.o dbhelpers.o \ 32 COMMONOBJS=dbutil.o buffer.o dbhelpers.o \
32 dss.o bignum.o \ 33 dss.o bignum.o \
33 signkey.o rsa.o dbrandom.o \ 34 signkey.o rsa.o dbrandom.o \
96 endif 97 endif
97 ifneq (,$(strip $(foreach prog, $(PROGRAMS), $(findstring ZdbclientZ, Z$(prog)Z)))) 98 ifneq (,$(strip $(foreach prog, $(PROGRAMS), $(findstring ZdbclientZ, Z$(prog)Z))))
98 CFLAGS+= -DDROPBEAR_CLIENT 99 CFLAGS+= -DDROPBEAR_CLIENT
99 endif 100 endif
100 101
101
102 # these are exported so that libtomcrypt's makefile will use them 102 # these are exported so that libtomcrypt's makefile will use them
103 export CC 103 export CC
104 export CFLAGS 104 export CFLAGS
105 export RANLIB AR STRIP 105 export RANLIB AR STRIP
106 106
119 CFLAGS+=-DPROGRESS_METER 119 CFLAGS+=-DPROGRESS_METER
120 endif 120 endif
121 121
122 all: $(TARGETS) 122 all: $(TARGETS)
123 123
124 # a bit lazy, but safer 124 # for simplicity assume all source depends on all headers
125 HEADERS=$(wildcard $(srcdir)/*.h *.h) 125 HEADERS=$(wildcard $(srcdir)/*.h *.h) $(OPTION_HEADERS)
126 *.o: $(HEADERS) 126 %.o : %.c $(HEADERS)
127 $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
128
129 default_options_guard.h: default_options.h
130 @echo Creating $@
131 @printf "/*\n > > > Do not edit this file (default_options_guard.h) < < <\nGenerated from "$^"\nLocal customisation goes in localoptions.h\n*/\n\n" > [email protected]
132 @$(srcdir)/ifndef_wrapper.sh < $^ >> [email protected]
133 @mv [email protected] $@
127 134
128 strip: $(TARGETS) 135 strip: $(TARGETS)
129 $(STRIP) $(addsuffix $(EXEEXT), $(TARGETS)) 136 $(STRIP) $(addsuffix $(EXEEXT), $(TARGETS))
130 137
131 install: $(addprefix inst_, $(TARGETS)) 138 install: $(addprefix inst_, $(TARGETS))
195 202
196 link%: 203 link%:
197 -rm -f $*$(EXEEXT) 204 -rm -f $*$(EXEEXT)
198 -ln -s dropbearmulti$(EXEEXT) $*$(EXEEXT) 205 -ln -s dropbearmulti$(EXEEXT) $*$(EXEEXT)
199 206
200 $(STATIC_LTC): 207 $(STATIC_LTC): $(OPTION_HEADERS)
201 $(MAKE) -C libtomcrypt 208 $(MAKE) -C libtomcrypt
202 209
203 $(STATIC_LTM): 210 $(STATIC_LTM): $(OPTION_HEADERS)
204 $(MAKE) -C libtommath 211 $(MAKE) -C libtommath
205 212
206 .PHONY : clean sizes thisclean distclean tidy ltc-clean ltm-clean 213 .PHONY : clean sizes thisclean distclean tidy ltc-clean ltm-clean
207 214
208 ltc-clean: 215 ltc-clean:
222 dropbearmulti$(EXEEXT) *.o *.da *.bb *.bbg *.prof 229 dropbearmulti$(EXEEXT) *.o *.da *.bb *.bbg *.prof
223 230
224 distclean: clean tidy 231 distclean: clean tidy
225 -rm -f config.h 232 -rm -f config.h
226 -rm -f Makefile 233 -rm -f Makefile
234 -rm -f default_options_guard.h
227 235
228 tidy: 236 tidy:
229 -rm -f *~ *.gcov */*~ 237 -rm -f *~ *.gcov */*~
230
231 # default_options.h is stored in version control, could not find a workaround
232 # for parallel "make -j" and dependency rules.
233 default_options.h: default_options.h.in
234 @echo Creating $@
235 @echo "/*\n > > > Do not edit this file (default_options.h) < < <\nGenerated from "$^"\nLocal customisation goes in localoptions.h\n*/\n\n" > [email protected]
236 @$(srcdir)/ifndef_wrapper.sh < $^ >> [email protected]
237 @mv [email protected] $@