core: Makefile don't worry about how deep the files are
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 8 Apr 2011 10:38:36 +0000 (03:38 -0700)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 8 Apr 2011 20:56:03 +0000 (13:56 -0700)
In preparation for importing lwip modify the makefile
to not care how deeply nested the source files are in the
tree.

core/Makefile

index 33ad7e9..44e1489 100644 (file)
@@ -39,9 +39,9 @@ BTARGET  = kwdhash.gen \
 # All primary source files for the main syslinux files
 NASMSRC         := $(wildcard *.asm)
 NASMHDR  := $(wildcard *.inc)
-CSRC    := $(wildcard *.c */*.c */*/*.c)
-SSRC    := $(wildcard *.S */*.S */*/*.S)
-CHDR    := $(wildcard *.h)
+CSRC    := $(shell find . -name '*.c' -print)
+SSRC    := $(shell find . -name '*.S' -print)
+CHDR    := $(shell find . -name '*.h' -print)
 OTHERSRC := keywords
 ALLSRC    = $(NASMSRC) $(NASMHDR) $(CSRC) $(SSRC) $(CHDR) $(OTHERSRC)
 
@@ -125,10 +125,11 @@ install-all: install install-lib
 netinstall: installer
 
 tidy dist:
-       rm -f codepage.cp *.o *.elf *.a stupid.* patch.offset .depend .*.d
+       find . -type f \( -name '*.o' -o -name '*.a' -o -name '.*.d' \
+               -o -name '*.lst' \) -print | xargs -rt rm -f
+       rm -f codepage.cp *.elf stupid.* patch.offset .depend
        rm -f *.elf.tmp *.sym
-       rm -f *.lsr *.lst *.map *.sec *.raw
-       rm -f */*.o */*/*.o */*.lst */*/*.lst */.*.d */*/.*.d
+       rm -f *.lsr *.map *.sec *.raw
        rm -f $(OBSOLETE) $(LIB)
 
 clean: tidy
@@ -137,4 +138,4 @@ spotless: clean
        rm -f $(BTARGET) *.bin *_bin.c
 
 # Include dependencies file
--include .*.d */.*.d */*/.*.d
+-include $(shell find . -name '.*.d' -print)