download thirdpart since we usually follow their HEAD: log SHA1 of their HEAD since thirdpart can evolve and breaking API. Keep a trace.
!!! IMPORTANT: manage multiple targets by project !!!
!!! make CXX=clang++-7 or emmake make always redo compilation from scratch ! Why ? !!!
SimForth: how to compile shared libs and target at the same time. idea replace OBJS by LIBS.
!!! IMPORTANT: disable debug and/or backward when compiling library or add -ldw !!! else backward segfault"
!!! compile library + in debug mode: add -debug libfoo-debug.so
Take into account CWEB
Take into account emscripten
Add bash script checking PKG_LIBS and SYSTEM_LIBS in thirdpart libs
Add bash script checking compilation flags: gcc $ALL_FLAGS foo.c => parse compilation flag not detected. Not not use them
The Makefile for unit tests cannot know TARGET of the main project. In the same idea: Makefile for compiling examples cannot know the name of the lib or the target of the main project.
Where to install .pc files ? /usr/share/pkgconfig/ or /usr/lib/pkgconfig ?
Cannot multiple inclusion of config.hpp** (first attempt failed)
Generate a config.hpp file (instead/in addition of a version.h file)
Rename RULE_INSTALL_DOC to RULE_INSTALL_PROJECT and change Installing: doc => /usr/share/xxx/0.1 to Installing: project => /usr/share/SimForth/0.1
Make shared VPATH and INCLUDES between all Makefiles. Won't do: Use Makefile.common.
!!! Bored of external/backward not always installed ar the root of the project.
MYMAKEFILES := depends on Makefile.common but this should be an optional file
Fix typo "not" in "You are not replacing recommended CXXFLAGS by your flags"
Remove $(P) of THIRDPART ?= $(P)/external => THIRDPART ?= external this fuck up VPATH. *!!! IMPORTANT:Ask why on stackoverflow !!!***
Auto install backward when building in debug mode:$(THIRDPART)/backward-cpp/.git/config:mkdir -p $(THIRDPART) && cd $(THIRDPART) && git clone https://github.com/Lecrapouille/backward-cpp.git --depth=1 > /dev/null 2> /dev/null
TODO:
-debug
libfoo-debug.soTake into account emscriptenThe Makefile for unit tests cannot know TARGET of the main project. In the same idea: Makefile for compiling examples cannot know the name of the lib or the target of the main project.Cannot multiple inclusion of config.hpp** (first attempt failed)Generate a config.hpp file (instead/in addition of a version.h file)Rename RULE_INSTALL_DOC to RULE_INSTALL_PROJECT and change Installing: doc => /usr/share/xxx/0.1 to Installing: project => /usr/share/SimForth/0.1Make shared VPATH and INCLUDES between all Makefiles.Won't do: Use Makefile.common.http://make.mad-scientist.net/papers/how-not-to-use-vpath/(ok: my VPATH if including BUILD is ok because of generated files stored here. ie version.h)add rules for compiling libraries and pkg-configLDFLAGS vs EXTERNAL_LIBS: when linking order of static lib is important (ie GL vs GLFW)Make the file VERSION be optional(won't do)Add an option for verbosing MakefileTodo INCLUDES +=pkg-config --cflags XXX
EXTERNAL_LIBS +=pkg-config --libs XXX
vs. CXXFLAGS +=pkg-config XXX
LDFLAGS +=pkg-config --libs XXX
Rethink g++/clang flagsmisplacement of Makefile.header Makefile.common (not the same for all projects + variables can be hidden like STANDARD = --std=c++14)(WIP)version.sh: Generate BUILD_TYPE in version.h (needed for example by loggers)Missing flags: -Wsign-conversion -Wformat -Wpessimizzing-moveBugs:
!!! Bored of external/backward not always installed ar the root of the project.MYMAKEFILES := depends on Makefile.common but this should be an optional fileFix typo "not" in "You are not replacing recommended CXXFLAGS by your flags"Remove*!!! IMPORTANT:Ask why on stackoverflow !!!***$(P)
ofTHIRDPART ?= $(P)/external
=>THIRDPART ?= external
this fuck up VPATH.Auto install backward when building in debug mode:$(THIRDPART)/backward-cpp/.git/config:mkdir -p $(THIRDPART) && cd $(THIRDPART) && git clone https://github.com/Lecrapouille/backward-cpp.git --depth=1 > /dev/null 2> /dev/null