Added a few targets to the makefile: dist, distclean, prof

The prof target takes an optional tag variable to customize the generated file name
This commit is contained in:
Nicolas Van Wambeke 2016-06-19 13:34:18 +02:00
parent 9cf49fe991
commit 8ff0603d6a

View file

@ -1,6 +1,15 @@
DATE := `date +'%Y%m%d'`
TAG := moodle-$(USER)
ifneq ($(tag),)
TAG := $(TAG)-$(tag)
endif
CC := gcc
LD := gcc
TAR_FILENAME := $(DATE)-mictcp-$(TAG).tar.gz
MODULES := api apps
SRC_DIR := $(addprefix src/,$(MODULES)) src
BUILD_DIR := $(addprefix build/,$(MODULES)) build
@ -40,4 +49,15 @@ $(BUILD_DIR):
clean:
@rm -rf $(BUILD_DIR)
distclean:
@rm -rf $(BUILD_DIR)
@-rm -f *.tar.gz || true
$(foreach bdir,$(BUILD_DIR),$(eval $(call make-goal,$(bdir))))
dist:
@tar --exclude=build --exclude=*tar.gz --exclude=.git* -czvf mictcp-bundle.tar.gz ../mictcp
prof:
@tar --exclude=build --exclude=.*tar.gz --exclude=video -czvf $(TAR_FILENAME) ../mictcp