summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2018-02-19 22:16:50 +0800
committerMatt Johnston <matt@ucc.asn.au>2018-02-19 22:16:50 +0800
commitef7c8c0c26129113b0955652dc254399a5fbfa3f (patch)
tree25dfc713ef4606895303e674e3e8e6f941874a39 /Makefile.in
parent7e4d9b58271fcdb208d1403474fa517c8efed99b (diff)
downloaddropbear-ef7c8c0c26129113b0955652dc254399a5fbfa3f.tar.gz
- 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
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in30
1 files changed, 15 insertions, 15 deletions
diff --git a/Makefile.in b/Makefile.in
index 8c9fbfe..1d5f7ed 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -23,9 +23,10 @@ CFLAGS+=-I$(srcdir)/libtomcrypt/src/headers/
LIBTOM_LIBS=$(STATIC_LTC) $(STATIC_LTM)
endif
+OPTION_HEADERS = default_options_guard.h sysoptions.h
ifneq ($(wildcard localoptions.h),)
CFLAGS+=-DLOCALOPTIONS_H_EXISTS
-LOCALOPTIONS_H=localoptions.h
+OPTION_HEADERS += localoptions.h
endif
COMMONOBJS=dbutil.o buffer.o dbhelpers.o \
@@ -98,7 +99,6 @@ ifneq (,$(strip $(foreach prog, $(PROGRAMS), $(findstring ZdbclientZ, Z$(prog)Z)
CFLAGS+= -DDROPBEAR_CLIENT
endif
-
# these are exported so that libtomcrypt's makefile will use them
export CC
export CFLAGS
@@ -121,9 +121,16 @@ endif
all: $(TARGETS)
-# a bit lazy, but safer
-HEADERS=$(wildcard $(srcdir)/*.h *.h)
-*.o: $(HEADERS)
+# for simplicity assume all source depends on all headers
+HEADERS=$(wildcard $(srcdir)/*.h *.h) $(OPTION_HEADERS)
+%.o : %.c $(HEADERS)
+ $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
+
+default_options_guard.h: default_options.h
+ @echo Creating $@
+ @printf "/*\n > > > Do not edit this file (default_options_guard.h) < < <\nGenerated from "$^"\nLocal customisation goes in localoptions.h\n*/\n\n" > $@.tmp
+ @$(srcdir)/ifndef_wrapper.sh < $^ >> $@.tmp
+ @mv $@.tmp $@
strip: $(TARGETS)
$(STRIP) $(addsuffix $(EXEEXT), $(TARGETS))
@@ -197,10 +204,10 @@ link%:
-rm -f $*$(EXEEXT)
-ln -s dropbearmulti$(EXEEXT) $*$(EXEEXT)
-$(STATIC_LTC):
+$(STATIC_LTC): $(OPTION_HEADERS)
$(MAKE) -C libtomcrypt
-$(STATIC_LTM):
+$(STATIC_LTM): $(OPTION_HEADERS)
$(MAKE) -C libtommath
.PHONY : clean sizes thisclean distclean tidy ltc-clean ltm-clean
@@ -224,14 +231,7 @@ thisclean:
distclean: clean tidy
-rm -f config.h
-rm -f Makefile
+ -rm -f default_options_guard.h
tidy:
-rm -f *~ *.gcov */*~
-
-# default_options.h is stored in version control, could not find a workaround
-# for parallel "make -j" and dependency rules.
-default_options.h: default_options.h.in
- @echo Creating $@
- @echo "/*\n > > > Do not edit this file (default_options.h) < < <\nGenerated from "$^"\nLocal customisation goes in localoptions.h\n*/\n\n" > $@.tmp
- @$(srcdir)/ifndef_wrapper.sh < $^ >> $@.tmp
- @mv $@.tmp $@