Commit e1d391d2 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Add cleanup rule

parent 2e57987c
......@@ -14,6 +14,12 @@ all:
@echo >&2
@exit 1
%.CLEAN:
for d in $$(./tools/find_linux_targets $*) \
$$(./tools/find_avr_targets $*) ; do \
make -C $${d} $@ ; \
done
%.LOAD:
make -C $$(./tools/find_avr_targets $*) $@
......@@ -22,3 +28,4 @@ all:
%.LINUX:
make -C $$(./tools/find_linux_targets $*) $@
......@@ -16,6 +16,9 @@ ifeq ($(TARGET),)
all: $(TARGETS:%=%.LINK)
%.CLEAN:
rm -rf compiled/$*
%.LINK:
@mkdir -p compiled/$*
make --no-print-directory TARGET=$* $*.LINK
......
......@@ -9,6 +9,10 @@ all: pciotest.LINUX
%.LINUX: compiled/% | compiled
@/bin/true
.PHONY: %.CLEAN
%.CLEAN: clean
@/bin/true
.PRECIOUS: compiled/%
compiled/%: %.c | compiled
echo $*
......
......@@ -16,7 +16,9 @@ all_avr_programs() {
}
target_dir() {
dirname $(egrep -l "$1.CHIP=" ${ROOTDIR}/*/avr/Makefile)
local MAKEFILE
MAKEFILE=$(egrep -l "$1.CHIP=" ${ROOTDIR}/*/avr/Makefile)
[ -n ${MAKEFILE} ] && dirname ${MAKEFILE}
}
if [ $# -eq 0 ] ; then
......
......@@ -17,7 +17,9 @@ all_linux_programs() {
}
target_dir() {
dirname $(egrep -l "^CFLAGS.$1=" ${ROOTDIR}/*/linux/Makefile)
local MAKEFILE
MAKEFILE=$(egrep -l "^CFLAGS.$1=" ${ROOTDIR}/*/linux/Makefile)
[ -n ${MAKEFILE} ] && dirname ${MAKEFILE}
}
if [ $# -eq 0 ] ; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment