omni-makefile
authorMazet Laurent <laurent.mazet@thalesgroup.com>
Fri, 20 Jun 2025 06:49:44 +0000 (08:49 +0200)
committerMazet Laurent <laurent.mazet@thalesgroup.com>
Fri, 20 Jun 2025 06:49:44 +0000 (08:49 +0200)
.gitignore
doxygen.conf
makefile

index c6775da5ec0be795bd2ae18ba18f90e8e3088859..435e061e70e44b61a4432974257a7623263614b0 100644 (file)
@@ -1,5 +1,24 @@
 *.d
 *.ld
+*.lld
 *.o
+
 *.exe
 *.a
+
+*.gcda
+*.gcno
+*.gcov
+*.glog
+*.log
+*.test
+
+*~
+*.bak
+
+.exec_*
+gmon.out
+
+.depends
+documentation
+changelog.txt
index cb87af0492b3543eac082e90bade4cc0d2fbaf92..0138bceb51b818c16cf1364ee0fd2cf420e46042 100644 (file)
@@ -925,10 +925,9 @@ INPUT_ENCODING         = UTF-8
 # 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.
index ec39cae8872eb27569a6d98e2f4df380764df636..85e3b4dfd733199c6945542efe932812f91108f4 100644 (file)
--- a/makefile
+++ b/makefile
@@ -84,7 +84,8 @@ DATE = $(shell git log -1 HEAD --format=%ai|awk '{print $$1}')
 ## 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
@@ -100,13 +101,21 @@ clean:
        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))
 
@@ -119,7 +128,7 @@ lib: depends
 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:
@@ -137,7 +146,8 @@ tests:
        $(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
@@ -150,7 +160,7 @@ gcov_%:
        $(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
@@ -257,7 +267,7 @@ changelog:
 
 ## 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