1.1 --- a/src/Makefile Fri Sep 29 20:30:31 2023 +0200 1.2 +++ b/src/Makefile Sun Oct 01 14:25:26 2023 +0200 1.3 @@ -25,8 +25,8 @@ 1.4 1.5 BUILD_DIR = ../build 1.6 SRC = arguments.c bfile_heuristics.c cline.c regex_parser.c scanner.c settings.c string_list.c 1.7 - 1.8 OBJ = $(SRC:%.c=$(BUILD_DIR)/%.o) 1.9 +CFLAGS += -DVERSION='"$(VERSION)"' 1.10 1.11 all: $(BUILD_DIR)/cline FORCE 1.12 echo "Build successful." 1.13 @@ -37,10 +37,40 @@ 1.14 1.15 $(BUILD_DIR)/cline: $(OBJ) 1.16 echo "Linking executable..." 1.17 - $(CC) $(LDFLAGS) -o $@ $(OBJ) 1.18 - 1.19 -$(BUILD_DIR)/%.o: %.c 1.20 - echo "Compiling $<" 1.21 - $(CC) $(CFLAGS) -DVERSION='"$(VERSION)"' -c -o $@ $< 1.22 + $(CC) $(LDFLAGS) -o $@ $^ 1.23 1.24 FORCE: 1.25 + 1.26 +$(BUILD_DIR)/arguments.o: arguments.c arguments.h stdinc.h string_list.h 1.27 + echo "Compiling $<" 1.28 + $(CC) -o $@ $(CFLAGS) -c $< 1.29 + 1.30 +$(BUILD_DIR)/bfile_heuristics.o: bfile_heuristics.c bfile_heuristics.h \ 1.31 + stdinc.h 1.32 + echo "Compiling $<" 1.33 + $(CC) -o $@ $(CFLAGS) -c $< 1.34 + 1.35 +$(BUILD_DIR)/cline.o: cline.c cline.h stdinc.h settings.h string_list.h \ 1.36 + bfile_heuristics.h regex_parser.h scanner.h arguments.h 1.37 + echo "Compiling $<" 1.38 + $(CC) -o $@ $(CFLAGS) -c $< 1.39 + 1.40 +$(BUILD_DIR)/regex_parser.o: regex_parser.c regex_parser.h string_list.h \ 1.41 + stdinc.h 1.42 + echo "Compiling $<" 1.43 + $(CC) -o $@ $(CFLAGS) -c $< 1.44 + 1.45 +$(BUILD_DIR)/scanner.o: scanner.c scanner.h stdinc.h settings.h \ 1.46 + string_list.h bfile_heuristics.h regex_parser.h 1.47 + echo "Compiling $<" 1.48 + $(CC) -o $@ $(CFLAGS) -c $< 1.49 + 1.50 +$(BUILD_DIR)/settings.o: settings.c settings.h stdinc.h string_list.h \ 1.51 + bfile_heuristics.h regex_parser.h 1.52 + echo "Compiling $<" 1.53 + $(CC) -o $@ $(CFLAGS) -c $< 1.54 + 1.55 +$(BUILD_DIR)/string_list.o: string_list.c string_list.h stdinc.h 1.56 + echo "Compiling $<" 1.57 + $(CC) -o $@ $(CFLAGS) -c $< 1.58 +