altos: Have 'make clean' remove all programs, even old ones
authorKeith Packard <keithp@keithp.com>
Wed, 11 Jul 2012 20:49:26 +0000 (13:49 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 11 Jul 2012 20:49:26 +0000 (13:49 -0700)
This makes sure that changing version numbers doesn't leave old
compiled output lying around.

Signed-off-by: Keith Packard <keithp@keithp.com>
15 files changed:
src/cc1111/Makefile.cc1111
src/megametrum-v0.1/Makefile
src/product/Makefile.telebt
src/product/Makefile.teledongle
src/product/Makefile.telelaunch
src/product/Makefile.telemetrum
src/product/Makefile.telemini
src/product/Makefile.telenano
src/stm-demo/Makefile
src/teleballoon-v1.1/Makefile
src/telescience-v0.1/Makefile
src/teleshield-v0.1/Makefile
src/teleterra-v0.2/Makefile
src/test/Makefile
src/tidongle/Makefile

index 8de4a9b290f282043e39ca2f358dc6d50a5cdd71..f7ecce33d019597ad9d25a95bbacdc268db78b75 100644 (file)
@@ -25,3 +25,11 @@ PAOM=$(PROG:.ihx=)
 
 %.rel : %.c $(INC)
        $(call quiet,CC,$(PRODUCT_DEF)) $(CFLAGS) -c -o$@ $<
+
+all:
+
+clean-cc1111:
+       rm -f *.adb *.asm *.lnk *.lst *.rel *.rst *.sym
+       rm -f $(PROGNAME)-*
+       rm -f ao_product.h
+       rm -f ../$(PROGNAME)-*
index 13e46c97aff66520cc17b3e5744ee0b62511ced6..59cfb64d0449811d5bf0fc128acd31efb817c2d0 100644 (file)
@@ -82,7 +82,8 @@ IDPRODUCT=0x0023
 
 CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) -Os -g
 
-PROG=megametrum-v0.1-$(VERSION).elf
+PROGNAME=megametrum-v0.1
+PROG=$(PROGNAME)-$(VERSION).elf
 
 SRC=$(ALTOS_SRC) ao_megametrum.c
 OBJ=$(SRC:.c=.o)
@@ -103,7 +104,7 @@ ao_product.h: ao-make-product.5c ../Version
 distclean:     clean
 
 clean:
-       rm -f $(OBJ)
+       rm -f *.o $(PROGNAME)-*.elf
        rm -f ao_product.h
 
 install:
index 90525d63edd0961186f9d641be5cbb18c11f88f0..fd52cec4f0133f03ab1bdfed1cfb8f13a2e508af 100644 (file)
@@ -60,7 +60,8 @@ SRC = \
        $(PRODUCT_SRC) \
        $(TELEBT_SRC)
 
-PROG = telebt-v$(TELEBT_VER)-$(VERSION).ihx
+PROGNAME = telebt-v$(TELEBT_VER)
+PROG = $(PROGNAME)-$(VERSION).ihx
 PRODUCT=TeleBT-v$(TELEBT_VER)
 PRODUCT_DEF=-DTELEBT_V_$(TELEBT_DEF)
 IDPRODUCT=0x000e
@@ -78,9 +79,9 @@ endif
 # Otherwise, print the full command line.
 quiet ?= $($1)
 
-all: ../$(PROG)
+all: $(PROG)
 
-../$(PROG): $(REL) Makefile
+$(PROG): $(REL) Makefile
        $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
        $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM) || rm $@
 
@@ -89,11 +90,7 @@ ao_product.h: ao-make-product.5c ../Version
 
 distclean:     clean
 
-clean:
-       rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
-       rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
-       rm -f ao_product.h
-       rm -f ../$(PROG) ../$(PMAP)
+clean: clean-cc1111
 
 install:
 
index fbf14a04f430cb3c487175bcf66341c024a61b41..5105b567dc234e1ee8f31a138a63175acb99dda8 100644 (file)
@@ -60,7 +60,8 @@ SRC = \
        $(DRIVER_SRC) \
        $(PRODUCT_SRC)
 
-PROG = teledongle-v$(TD_VER)-$(VERSION).ihx
+PROGNAME = teledongle-v$(TD_VER)
+PROG = $(PROGNAME)-$(VERSION).ihx
 PRODUCT=TeleDongle-v$(TD_VER)
 PRODUCT_DEF=-DTELEDONGLE_V_$(TD_DEF)
 IDPRODUCT=0x000c
@@ -89,11 +90,7 @@ ao_product.h: ao-make-product.5c ../Version
 
 distclean:     clean
 
-clean:
-       rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
-       rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
-       rm -f ao_product.h
-       rm -f ../$(PROG) ../$(PMAP)
+clean: clean-cc1111
 
 install:
 
index 3753f3c9d22863508aec88920f480355523aaee5..1e55989c36e07eeb2acb8c9bf7d2717bfeceb38f 100644 (file)
@@ -62,7 +62,8 @@ SRC = \
        $(DRIVER_SRC) \
        $(PRODUCT_SRC)
 
-PROG = telelaunch-v$(TELELAUNCH_VER)-$(VERSION).ihx
+PROGNAME = telelaunch-v$(TELELAUNCH_VER)
+PROG = $(PROGNAME)-$(VERSION).ihx
 PRODUCT=TeleLaunch-v$(TELELAUNCH_VER)
 PRODUCT_DEF=-DTELELAUNCH_V_$(TELELAUNCH_DEF)
 IDPRODUCT=0x000f
@@ -92,11 +93,7 @@ ao_product.h: ao-make-product.5c ../Version
 
 distclean:     clean
 
-clean:
-       rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
-       rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
-       rm -f ao_product.h
-       rm -f ../$(PROG) ../$(PMAP)
+clean: clean-cc1111
 
 install:
 
index 57586c9572f77c7c8cb5af3c5d09ce07854ab0dc..5e3eed7f96cdfb33eaae6f0d2075cb724bb5766d 100644 (file)
@@ -75,7 +75,8 @@ SRC = \
        $(DRIVER_SRC) \
        $(PRODUCT_SRC)
 
-PROG = telemetrum-v$(TM_VER)-$(VERSION)$(TM_EXTRA).ihx
+PROGNAME = telemetrum-v$(TM_VER)$(TM_EXTRA)
+PROG = $(PROGNAME)-$(VERSION).ihx
 PRODUCT=TeleMetrum-v$(TM_VER)
 PRODUCT_DEF=-DTELEMETRUM_V_$(TM_DEF)
 IDPRODUCT=0x000b
@@ -104,11 +105,7 @@ ao_product.h: ao-make-product.5c ../Version
 
 distclean:     clean
 
-clean:
-       rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
-       rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
-       rm -f ao_product.h
-       rm -f ../$(PROG) ../$(PMAP)
+clean: clean-cc1111
 
 install:
 
index 23aed1c7dcb3b44eadb4dec86067c6ff9a4031d6..ef8906badf6d90417d8123b4afaae115bef08327 100644 (file)
@@ -63,7 +63,8 @@ SRC = \
        $(DRIVER_SRC) \
        $(PRODUCT_SRC)
 
-PROG = telemini-v$(TELEMINI_VER)-$(VERSION).ihx
+PROGNAME = telemini-v$(TELEMINI_VER)
+PROG = $(PROGNAME)-$(VERSION).ihx
 PRODUCT=TeleMini-v$(TELEMINI_VER)
 PRODUCT_DEF=-DTELEMINI_V_$(TELEMINI_DEF)
 IDPRODUCT=0x000a
@@ -93,11 +94,7 @@ ao_product.h: ao-make-product.5c ../Version
 
 distclean:     clean
 
-clean:
-       rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
-       rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
-       rm -f ao_product.h
-       rm -f ../$(PROG) ../$(PMAP)
+clean: clean-cc1111
 
 install:
 
index ca719bbf9980e1e4813b5f377c6373438d760675..67410ae0bd5332b8f3e15840ca087b71c850fae6 100644 (file)
@@ -62,7 +62,8 @@ SRC = \
        $(DRIVER_SRC) \
        $(PRODUCT_SRC)
 
-PROG = telenano-v$(TELENANO_VER)-$(VERSION).ihx
+PROGNAME = telenano-v$(TELENANO_VER)
+PROG = $(PROGNAME)-$(VERSION).ihx
 PRODUCT=TeleNano-v$(TELENANO_VER)
 PRODUCT_DEF=-DTELENANO_V_$(TELENANO_DEF)
 IDPRODUCT=0x000a
@@ -92,11 +93,7 @@ ao_product.h: ao-make-product.5c ../Version
 
 distclean:     clean
 
-clean:
-       rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
-       rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
-       rm -f ao_product.h
-       rm -f ../$(PROG) ../$(PMAP)
+clean: clean-cc1111
 
 install:
 
index dd7e6e02310f65de516dfbeb1b1421a67bedecba..055a73af2ffd8779d80954685359ec3188f906e2 100644 (file)
@@ -61,7 +61,7 @@ $(OBJ): $(INC)
 distclean:     clean
 
 clean:
-       rm -f $(OBJ)
+       rm -f *.o $(PROG)
        rm -f ao_product.h
 
 install:
index fb88787b94097a3b523f8fc1284363da2181d014..2eea996e7166762202f8864e17afa10beb087efc 100644 (file)
@@ -81,7 +81,8 @@ SRC = \
        $(DRIVER_SRC) \
        $(PRODUCT_SRC)
 
-PROG = teleballoon-v$(TELEBALLOON_VER)-$(VERSION).ihx
+PROGNAME = teleballoon-v$(TELEBALLOON_VER)
+PROG = $(PROGNAME)-$(VERSION).ihx
 PRODUCT=TeleBalloon-v$(TELEBALLOON_VER)
 PRODUCT_DEF=-DTELEBALLOON_V_$(TELEBALLOON_DEF)
 IDPRODUCT=0x000b
@@ -99,9 +100,9 @@ endif
 # Otherwise, print the full command line.
 quiet ?= $($1)
 
-all: ../$(PROG)
+all: $(PROG)
 
-../$(PROG): $(REL) Makefile
+$(PROG): $(REL) Makefile
        $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(REL) && cp $(PROG) $(PMAP) ..
        $(call quiet,CHECK_STACK) ../cc1111/ao_arch.h $(PMEM) || rm $@
 
@@ -110,11 +111,7 @@ ao_product.h: ao-make-product.5c ../Version
 
 distclean:     clean
 
-clean:
-       rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
-       rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
-       rm -f ao_product.h
-       rm -f ../$(PROG) ../$(PMAP)
+clean: clean-cc1111
 
 install:
 
index 10e4a2a301e01f5600fa56f3270dcd6e111b7427..d24128ef53a2161e51e85b659126038045ae8e75 100644 (file)
@@ -105,7 +105,7 @@ ao_product.o: ao_product.c ao_product.h
 distclean:     clean
 
 clean:
-       rm -f $(OBJ)
+       rm -f *.o $(PROG) $(PROG).hex
        rm -f ao_product.h
 
 install:
index c1f45f37ecd1eae2f9f7c1434b285e6e51a85a71..ab2a025f4004da4c60b077882f4d8c5a07b83776 100644 (file)
@@ -72,7 +72,8 @@ SRC = \
        $(DRIVER_SRC) \
        $(PRODUCT_SRC)
 
-PROG = teleshield-v$(TELESHIELD_VER)-$(VERSION).ihx
+PROGNAME = teleshield-v$(TELESHIELD_VER)
+PROG = $(PROGNAME)-$(VERSION).ihx
 PRODUCT=TeleShield-v$(TELESHIELD_VER)
 PRODUCT_DEF=-DTELESHIELD_V_$(TELESHIELD_DEF)
 IDPRODUCT=0x0013
@@ -102,11 +103,7 @@ ao_product.h: ao-make-product.5c ../Version
 
 distclean:     clean
 
-clean:
-       rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
-       rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
-       rm -f ao_product.h
-       rm -f ../$(PROG) ../$(PMAP)
+clean: clean-cc1111
 
 install:
 
index 4967d1874722a54f44510f584de90acc51d28a02..65db57ce5191a0e1167174f7dca904c4059ff7ba 100644 (file)
@@ -66,7 +66,8 @@ SRC = \
 
 TELETERRA_VER=0.2
 TELETERRA_DEF=0_2
-PROG = teleterra-v$(TELETERRA_VER)-$(VERSION).ihx
+PROGNAME = teleterra-v$(TELETERRA_VER)
+PROG = $(PROGNAME)-$(VERSION).ihx
 PRODUCT=TeleTerra-v$(TELETERRA_VER)
 PRODUCT_DEF=-DTELETERRA_V_$(TELETERRA_DEF)
 IDPRODUCT=0x000d
@@ -95,11 +96,7 @@ ao_product.h: ao-make-product.5c ../Version
 
 distclean:     clean
 
-clean:
-       rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
-       rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
-       rm -f ao_product.h
-       rm -f ../$(PROG) ../$(PMAP)
+clean: clean-cc1111
 
 install:
 
index 963f413162c34298f1c2a9df0310aed64a1ca72e..db3cc04b006cd8e512e69b049ebeb914ba350767 100644 (file)
@@ -9,7 +9,7 @@ CFLAGS=-I.. -I. -I../core -I../drivers -O3 -g -Wall
 all: $(PROGS)
 
 clean:
-       rm -f $(PROGS)
+       rm -f $(PROGS) run-out.baro run-out.full
 
 install:
 
index 0bb2ce320adf22ebd0937e9c8ae487a4fdb5a889..1514c4dfe9f639fd43f59ab30f4058b16ec72b3f 100644 (file)
@@ -53,7 +53,8 @@ SRC = \
        $(DRIVER_SRC) \
        $(PRODUCT_SRC)
 
-PROG = tidongle-$(VERSION).ihx
+PROGNAME = tidongle
+PROG = $(PROGNAME)-$(VERSION).ihx
 PRODUCT=TIDongle
 PRODUCT_DEF=-DTIDONGLE
 IDPRODUCT=0x000a
@@ -82,11 +83,7 @@ ao_product.h: ao-make-product.5c ../Version
 
 distclean:     clean
 
-clean:
-       rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM)
-       rm -f $(PROG) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM)
-       rm -f ao_product.h
-       rm -f ../$(PROG) ../$(PMAP)
+clean: clean-cc1111
 
 install: