Set the close-on-exec flag, just to be saf
[oweals/busybox.git] / Makefile
index dc299cded19dc0eda9cb7ae05630e09373a769b9..4a7195314d0c3013cde74b30ba67da502c496e2e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,7 @@ endif
 
 
 busybox: depend $(libraries-y)
-       $(CC) $(LDFLAGS) $(libraries-y) $(LIBRARIES) -o $@
+       $(CC) $(LDFLAGS) -o $@ $(libraries-y) $(LIBRARIES)
        $(STRIPCMD) $@
 
 busybox.links: applets/busybox.mkll
@@ -160,21 +160,20 @@ $(TOPDIR)include/config.h:
        fi;
 
 $(TOPDIR).config:
-       cp $(TOPDIR)sysdeps/$(TARGET_OS)/defconfig $(TOPDIR).config
-       mkdir -p $(TOPDIR)include/config
-       $(MAKE) -C scripts/lxdialog all
-       $(BB_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in
+       @if [ ! -f $(TOPDIR).config ] ; then \
+           cp $(TOPDIR)sysdeps/$(TARGET_OS)/defconfig $(TOPDIR).config; \
+       fi;
 
-menuconfig:
+menuconfig: $(TOPDIR).config
        mkdir -p $(TOPDIR)include/config
        $(MAKE) -C scripts/lxdialog all
        $(BB_SHELL) scripts/Menuconfig sysdeps/$(TARGET_OS)/config.in
 
-config:
+config: $(TOPDIR).config
        mkdir -p $(TOPDIR)include/config
        $(BB_SHELL) scripts/Configure sysdeps/$(TARGET_OS)/config.in
 
-oldconfig:
+oldconfig: $(TOPDIR).config
        mkdir -p $(TOPDIR)include/config
        $(BB_SHELL) scripts/Configure -d sysdeps/$(TARGET_OS)/config.in
 
@@ -222,10 +221,10 @@ clean:
        - rm -f busybox busybox.links libbb/loop.h .config.old .hdepend
        - rm -f scripts/split-include scripts/mkdep .*config.log
        - rm -rf include/config include/config.h
-       - find -name .\*.flags -exec rm -f {} \;   
-       - find -name .depend -exec rm -f {} \;
-       - find -name \*.o -exec rm -f {} \;
-       - find -name \*.a -exec rm -f {} \;
+       - find -name .\*.flags -exec rm -f {} \;   
+       - find -name .depend -exec rm -f {} \;
+       - find -name \*.o -exec rm -f {} \;
+       - find -name \*.a -exec rm -f {} \;
 
 distclean: clean
        - rm -f busybox