RANLIB ?= ranlib
#INCLUDES = -I../debug -D__MEMORY_ALLOCATION__
-INCLUDES = -D_DEFAULT_SOURCE=1
INCLUDES += -DVERBOSE_COLOR=1
#INCLUDES += -DVERBOSE_LOCATION=1
OFLAGS = -O4 -Os
GETCOMMENTS = awk '/\/\*[ \t]*$(1):/,/\*\// { sub(/.*\/\*[ \t]*$(1):/, ""); sub (/[ \t]*\*\/.*/, ""); print } /\/\/[ \t]*$(1):/ {sub (/.*\/\/[ \t]*$(1):/, ""); print }' $(2)
#GETCOMMENTS = perl -- getcomments.pl -p='$(1):\s' -f='%' $(2)
+DATE = $(shell git log -1 HEAD --format=%ai|awk '{print $$1}')
+#DATE = $(shell hg log -r-1 --template '{date|isodate}'|awk '{print $$1}')
+
## Generic rules
all: depends
clean:
$(call TITLE, "Cleaning")
touch clean
- rm -f clean $(wildcard *.d *.ld *.log *.o *.test *~ .exec_* gmon.out _)
+ rm -f clean $(wildcard *.d *.ld *.lld *.log *.o *.test *~ .exec_* gmon.out _)
$(call PASS, SUCCESS)
-depends: $(patsubst %.c, %.d, $(wildcard *.c)) $(patsubst %, %.ld, $(ALLEXE))
+depends: $(patsubst %.c, %.d, $(wildcard *.c)) $(patsubst %, %.ld, $(ALLEXE)) $(patsubst %, %.lld, $(ALLDLL))
documentation: doxygen.conf $(shell awk '{sub(/#.*/,"")} /^FILE_PATTERNS/,!/\\$$/ {sub(/\\$$/,"");sub(/.*=/,"");print}' doxygen.conf)
doxygen $<; true
$(MAKE) all
$(MAKE) $(addprefix test_,$(ALLEXE))
+archive: wipe changelog documentation
+ name=`basename "$$(pwd)"`; cd ..; tar cvz --exclude='.git*' -f $$name-$(DATE).tgz $$name
+
## Main rules
include $(wildcard *.d)
include $(wildcard *.ld)
+include $(wildcard *.lld)
gcov_%:
$(MAKE) purge
$(MV) $@~ $@
$(call PASS, SUCCESS)
+lib%.lld: %.c
+ $(call TITLE, "Building $@")
+ echo ${@:.lld=.a}: $(shell $(call GETCOMMENTS,$(AROPT), $<) | awk '{for (i=1;i<=NF;i++) if ($$(i) ~ /.o$$/) printf " %s", $$(i)}') > $@
+ $(call PASS, SUCCESS)
+
%.ld: %.c
$(call TITLE, "Building $@")
echo ${<:.c=.exe}: $(shell $(call GETCOMMENTS,$(LDOPT), $<) | awk '{for (i=1;i<=NF;i++) if ($$(i) ~ /.o$$/) printf " %s", $$(i)}') > $@
install_exe:
make $(addprefix install_,$(ALLEXE))
+changelog:
+ echo "Logs from $(DATE)" > $@.txt
+ git log --pretty=format:'- %s' >> $@.txt
+# hg log --template changelog >>$@.txt
+
## Phony
-.PHONY: all analyze clean count depends documentation gcovs purge tests
+.PHONY: all analyze changelog clean count depends documentation gcovs purge tests
## Precious