summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@samba.org>1998-10-05 00:43:48 +0000
committerAlexandre Oliva <oliva@samba.org>1998-10-05 00:43:48 +0000
commit02b6c4eff216519a1ce9ce0a4cd89432b3df4f66 (patch)
treefb9afcad3dee199ea46a36097671621cfe2b0d4d
parent791b837af196c895d17512a9a72e293f0c4ef32e (diff)
downloadsamba-02b6c4eff216519a1ce9ce0a4cd89432b3df4f66.tar.gz
samba-02b6c4eff216519a1ce9ce0a4cd89432b3df4f66.tar.bz2
samba-02b6c4eff216519a1ce9ce0a4cd89432b3df4f66.zip
Speed up directory creation for the common case (i.e., it exists already)
Link $(LIBS) in when creating smbwrapper.so rm -rf bin in distclean rm smbwrapper files in realclean remove .h from .SUFFIXES (This used to be commit a38e7ea04ad74996c91cb1a4f9ed07ba98752a9b)
-rw-r--r--source3/Makefile.in40
1 files changed, 24 insertions, 16 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 6d27ffddce..05d3685500 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -231,18 +231,24 @@ all : CHECK $(SPROGS) $(PROGS)
smbwrapper : CHECK smbwrapper/smbsh smbwrapper/smbwrapper.so
.SUFFIXES:
-.SUFFIXES: .c .o .h .po
+.SUFFIXES: .c .o .po
CHECK:
@echo "Using FLAGS = $(FLAGS)"
@echo "Using LIBS = $(LIBS)"
+MAKEDIR = || exec false; \
+ if test -d "$$dir"; then :; else \
+ echo mkdir "$$dir"; \
+ mkdir -p "$$dir" >/dev/null 2>&1 || \
+ test -d "$$dir" || \
+ mkdir "$$dir" || \
+ exec false; fi || exec false
+
.c.o: @MAINT@ .deps/.dummy
+ @if (: > $@) >/dev/null 2>&1; then :; else \
+ dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
@echo Compiling $*.c
- @dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` && \
- if test ! -d "$$dir"; then \
- echo mkdir "$$dir" && mkdir "$$dir" || true; \
- else true; fi
@$(CC) -I. -I$(srcdir) $(FLAGS) -c $< -o $@ \
@MAINT@ -Wp,-MD,.deps/`echo $* | sed s,/,_,g`.P && : >.deps/.stamp
# the line above is for atomatic dependency tracking
@@ -250,17 +256,16 @@ CHECK:
.c.po: @MAINT@ .deps/.dummy
+ @if (: > $@) >/dev/null 2>&1; then :; else \
+ dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
@echo Compiling $*.c with -fpic
- @dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` && \
- if test ! -d "$$dir"; then \
- echo mkdir "$$dir" && mkdir "$$dir" || true; \
- else true; fi
@$(CC) -I. -I$(srcdir) $(FLAGS) -fpic -c $< -o $@ \
@MAINT@ -Wp,-MD,.deps/`echo $* | sed s,/,_,g`.P && : >.deps/.stamp
bin/.dummy:
- if test ! -d bin; then echo mkdir bin && mkdir bin || true; else true; fi
- @: > $@ # create it
+ @if (: > $@) >/dev/null 2>&1; then :; else \
+ dir=bin $(MAKEDIR); fi
+ @: > $@ # create it (what a fancy emoticon :-)
bin/smbd: $(SMBD_OBJ) bin/.dummy
@echo Linking $@
@@ -332,7 +337,7 @@ bin/smbtorture: $(SMBTORTURE_OBJ) bin/.dummy
smbwrapper/smbwrapper.so: $(PICOBJS)
@echo Linking shared library $@
- @$(LD) @LDSHFLAGS@ -o $@ $(PICOBJS)
+ @$(LD) @LDSHFLAGS@ -o $@ $(PICOBJS) $(LIBS)
smbwrapper/smbsh: smbwrapper/smbsh.in config.status
CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
@@ -394,12 +399,13 @@ ctags:
ctags `find . -name "*.[ch]"`
realclean: clean
- -rm -f config.log $(PROGS) $(SPROGS) smbsh
+ -rm -f config.log $(PROGS) $(SPROGS) bin/.dummy
+ -rm -f smbwrapper/smbsh smbwrapper/smbwrapper.so
distclean: realclean
-rm -f include/config.h include/stamp-h Makefile
-rm -f config.status config.cache
- -rm -rf .deps
+ -rm -rf .deps bin
# this target is really just for my use. It only works on a limited
# range of machines and is used to produce a list of potentially
@@ -442,8 +448,10 @@ $(srcdir)/include/stamp-h.in: @MAINT@ $(srcdir)/acconfig.h $(srcdir)/configure.i
# automatic dependency tracking rules
.deps/.dummy:
- @-if test ! -d .deps; then mkdir .deps || true; else true; fi
- @: >$@
+ @if (: > $@) >/dev/null 2>&1; then :; else \
+ dir=.deps $(MAKEDIR); fi
+ @: > $@ # create it (what a fancy emoticon :-)
+ @: > $@ # create it (what a fancy emoticon :-)
.deps/.stamp: .deps/.dummy
@: