- Make the library addition system cleaner and scalable
- Add a progress bar during compilation
The generate.sh script is a util script to init a project's directory. Start it in the folder where you want the project's folder wil be created and follow the instructions !
- You can choose the name of your executable with the variable
name - You can choose your compiler in the variable
CC - You can add some compilation flags (like
-lflags to add standard libraries) in the variableCFLAGS(The classic flags are managed in the options of the make command, see below)
- By default the Makefile compile with
-Wall -Wextra -Werror - With
make [rule] noflag, you can disable-Werror - With
make [rule] debug, you can add-g3 - With
make [rule] sanadd, you can add-fsanitize=address - With
make [rule] santhread, you can add-fsanitize=thread - If you don't specify a rule,
make noflagis equal tomake all noflag - All these flags are cumulativee (
make re noflag debug sanaddis valid)
- Use
SRCS_EXTENSIONto define the file type of your sources (.c/.cpp/...) - Your main must be defined in the variable
MAIN(If it is in the sources folder, calledSRCS_PATH, you must add it like thissrcs/main.c) - Add all other sources in
SRCS(without the folder defined inSRCS_PATH)
- Use
INCLUDE_DIRSto select all the folders where your headers are located
- You can enable the use of certain libraries in the corresponding sections. For each:
[LIB]_DIRis the directory where the Makefile of the library is located[LIB]_INCLUDE_DIRis the directory where the headers' files of the library are located[LIB]_NAMEis the name of the library with her extension, normally.a(she needs to be at the root of the[LIB]_DIRfolder)
$(NAME)compile the executableallcall$(NAME)cleanremove all compiled objectsfcleancallcleanand remove the executablerecallfcleanandallfcleanlibcallfcleanand executefcleanrule in the libraries' foldersrelibcallfcleanlibandallruncallalland launch the executable (You can precise some argument to give to the executable at launch inRUN_PARAM)showshow some useful informations about the Makefile's variables