diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2020-02-21 18:09:22 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2020-02-21 18:09:22 +0300 |
commit | a93c561921b79e5f27b986292fe70dce1879f91e (patch) | |
tree | e28853c5196344ac80f5ad04d16bab673733f499 /Makefile | |
parent | 83cd2267b309fa7411acaed356f88101196bb2ad (diff) | |
download | magi-a93c561921b79e5f27b986292fe70dce1879f91e.tar magi-a93c561921b79e5f27b986292fe70dce1879f91e.tar.xz magi-a93c561921b79e5f27b986292fe70dce1879f91e.zip |
[magi]
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 33 |
1 files changed, 15 insertions, 18 deletions
@@ -1,9 +1,10 @@ -### TODO: Partial compilation (e.g. cgi+urlenc, but without fcgi) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Compilation Options # Debug mode (allowing to debug the library via gdb): # DEBUG = yes -# Specify your favourite C compiler here (e.g. tcc): +# Optional modules (remove unwanted ones): +MODULES = cgi fastcgi loadfile urlenc +# Specify your favourite C compiler here: CC = gcc @@ -20,9 +21,17 @@ else CFLAGS += -O3 endif +# Interfacial files to compile: +INTER = cookie error file param request response $(MODULES) + # Object files listing: +INC_DIR = include/magi SRC_DIR = src -SRC = $(wildcard $(SRC_DIR)/*.c) +INTER_H = $(foreach name,$(INTER),$(INC_DIR)/$(name).h) +INTER_C = $(foreach name,$(INTER),$(SRC_DIR)/$(name).c) +INNER_H = $(wildcard $(SRC_DIR)/*.h) +INNER_C = $(INNER_H:.h=.c) +SRC = $(INTER_C) $(INNER_C) OBJ = $(SRC:.c=.o) @@ -33,27 +42,15 @@ default: $(LIB) # Cleaning means removing everything automatically produced: clean: - rm -f $(OBJ) $(LIB) deps.mk + rm -f $(OBJ) $(LIB) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Compilation # Compile object files from corresponding source and header: -%.o: %.c %.h - $(CC) $(CFLAGS) -c $< -o $@ +%.o: %.c + $(CC) $(CFLAGS) -I $(INC_DIR) -c $< -o $@ # Packing object files into library: $(LIB): $(OBJ) ar rcs $@ $^ - - -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# Dependencies -# Generating dependencies description file: -deps.mk: $(SRC) - $(CC) -MM $^ > $@ - -# While cleaning we need to remove it, not include: -ifneq "clean" "$(MAKECMDGOALS)" --include deps.mk -endif |