Merge pull request #615 from AndersHoglund/makefile_clean_rules
Tidy up the Makefile clean rules,
This commit is contained in:
commit
fc8a5b4f1c
34
Makefile
34
Makefile
|
@ -667,24 +667,36 @@ $(VALID_TARGETS):
|
||||||
$(MAKE) -j binary hex TARGET=$@ && \
|
$(MAKE) -j binary hex TARGET=$@ && \
|
||||||
echo "Building $@ succeeded."
|
echo "Building $@ succeeded."
|
||||||
|
|
||||||
## clean : clean up all temporary / machine-generated files
|
|
||||||
|
|
||||||
|
CLEAN_TARGETS = $(addprefix clean_,$(VALID_TARGETS) )
|
||||||
|
TARGETS_CLEAN = $(addsuffix _clean,$(VALID_TARGETS) )
|
||||||
|
|
||||||
|
## clean : clean up temporary / machine-generated files
|
||||||
clean:
|
clean:
|
||||||
|
echo "Cleaning $(TARGET)"
|
||||||
rm -f $(CLEAN_ARTIFACTS)
|
rm -f $(CLEAN_ARTIFACTS)
|
||||||
rm -rf $(OBJECT_DIR)/$(TARGET)
|
rm -rf $(OBJECT_DIR)/$(TARGET)
|
||||||
|
echo "Cleaning $(TARGET) succeeded."
|
||||||
|
|
||||||
## clean_test : clean up all temporary / machine-generated files (tests)
|
## clean_test : clean up temporary / machine-generated files (tests)
|
||||||
clean_test:
|
clean_test:
|
||||||
cd src/test && $(MAKE) clean || true
|
cd src/test && $(MAKE) clean || true
|
||||||
|
|
||||||
## clean_all_targets : clean all valid target platforms
|
## clean_<TARGET> : clean up one specific target
|
||||||
clean_all:
|
$(CLEAN_TARGETS) :
|
||||||
for clean_target in $(VALID_TARGETS); do \
|
$(MAKE) -j TARGET=$(subst clean_,,$@) clean
|
||||||
echo "" && \
|
|
||||||
echo "Cleaning $$clean_target" && \
|
## <TARGET>_clean : clean up one specific target (alias for above)
|
||||||
$(MAKE) -j TARGET=$$clean_target clean || \
|
$(TARGETS_CLEAN) :
|
||||||
break; \
|
$(MAKE) -j TARGET=$(subst _clean,,$@) clean
|
||||||
echo "Cleaning $$clean_target succeeded."; \
|
|
||||||
done
|
## clean_all : clean all valid targets
|
||||||
|
clean_all:$(CLEAN_TARGETS)
|
||||||
|
|
||||||
|
## all_clean : clean all valid targets (alias for above)
|
||||||
|
all_clean:$(TARGETS_CLEAN)
|
||||||
|
|
||||||
|
|
||||||
flash_$(TARGET): $(TARGET_HEX)
|
flash_$(TARGET): $(TARGET_HEX)
|
||||||
stty -F $(SERIAL_DEVICE) raw speed 115200 -crtscts cs8 -parenb -cstopb -ixon
|
stty -F $(SERIAL_DEVICE) raw speed 115200 -crtscts cs8 -parenb -cstopb -ixon
|
||||||
|
|
Loading…
Reference in New Issue