# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
# *.vhdl, *.ucf, *.qsf and *.ice.
-FILE_PATTERNS = morep.c \
- morep.h \
- parse.h \
- pdu_*.h
+FILE_PATTERNS = mapec.c \
+ mapec.h \
+ ulvpn.c
# The RECURSIVE tag can be used to specify whether or not subdirectories should
# be searched for input files as well.
## Generic rules
all: depends
- [ "$(ALLEXE)" ] || { $(call FAIL,no exec to proceed); test; } && $(MAKE) $(ALLEXE:%=%.exe)
+ [ -z "$(ALLEXE)" ] || $(MAKE) $(ALLEXE:%=%.exe)
+ [ -z "$(ALLDLL)" ] || $(MAKE) $(ALLDLL:%=%.a)
analyze:
make purge
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)) $(patsubst %, %.lld, $(ALLDLL))
+depends: .depends $(patsubst %.c, %.d, $(wildcard *.c)) $(patsubst %, %.ld, $(ALLEXE)) $(patsubst %, %.lld, $(ALLDLL))
+
+.depends:
+ [ "$(ALLEXE)" ] || $(call WARN,no exec to proceed)
+ [ "$(ALLDLL)" ] || $(call WARN,no library to proceed)
+ touch $@
-documentation: doxygen.conf $(shell awk '{sub(/#.*/,"")} /^FILE_PATTERNS/,!/\\$$/ {sub(/\\$$/,"");sub(/.*=/,"");print}' doxygen.conf)
+documentation: doxygen.conf $(shell test -f doxygen.conf && awk '{sub(/#.*/,"")} /^FILE_PATTERNS/,!/\\$$/ {sub(/\\$$/,"");sub(/.*=/,"");print}' doxygen.conf)
doxygen $<; true
sed -i s/__BEGIN_DECLS//g documentation/html/*.html
sed -i s/\\_\\-\\_BEGIN\\_\\-DECLS//g documentation/latex/*.tex
+exe: depends
+ [ "$(ALLEXE)" ] || { $(call FAIL,no exec to proceed); test; } && $(MAKE) $(ALLEXE:%=%.exe)
+
gcovs: wipe
$(MAKE) $(addprefix gcov_,$(ALLEXE))
purge: clean
$(call TITLE, "Purging")
touch purge
- rm -f purge $(ALLEXE:%=%.exe) $(ALLDLL:%=%.a)
+ rm -f purge $(wildcard .depends) $(ALLEXE:%=%.exe) $(ALLDLL:%=%.a)
$(call PASS, SUCCESS)
valgrinds:
$(MAKE) all
$(MAKE) $(addprefix test_,$(ALLEXE))
-archive: wipe changelog documentation
+archive: wipe changelog
+ [ \! -f doxygen.conf ] || make documentation
name=`basename "$$(pwd)"`; cd ..; tar cvz --exclude='.git*' -f $$name-$(DATE).tgz $$name
## Main rules
$(MAKE) purge
$(MAKE) depends
OPTIONS="-coverage -O0" $(MAKE) ${@:gcov_%=%}.exe
- umask 000; $(MAKE) test_$(@:gcov_%=%)
+ $(MAKE) test_$(@:gcov_%=%)
gcov `sed -e 's/\.exe:/.c/;s/\.o/.c/g;s/ -l[^ ]*//g' $(@:gcov_%=%.ld)`
$(MAKE) purge
grep '^ *#####' *.c.gcov || true
## Phony
-.PHONY: all analyze changelog clean count depends documentation gcovs purge tests
+.PHONY: all analyze archive changelog clean count depends documentation exe gcovs gprofs install_lib install_exe lib purge tests valgrinds wipe
## Precious