Makefile

changeset 74
831928419249
parent 72
b533da8e7411
--- a/Makefile	Sun Sep 24 18:48:42 2023 +0200
+++ b/Makefile	Sun Oct 01 14:41:17 2023 +0200
@@ -28,25 +28,25 @@
 
 include config.mk
 
-SRC  = frontend.c
-SRC += c2html.c
-SRC += highlighter.c
-
-OBJ = $(SRC:%.c=build/%.o)
-
 all: build build/c2html
 	
-build/c2html: $(OBJ)
-	$(CC) -o $@ $^ $(LDFLAGS)
-	
-build/%.o: src/%.c
+build/c2html: build/frontend.o build/highlighter.o build/c2html.o
+	$(CC) -o $@ $(LDFLAGS) $^
+
+build/c2html.o: src/c2html.c src/c2html.h src/highlighter.h
+	$(CC) -o $@ $(CFLAGS) -c $<
+
+build/frontend.o: src/frontend.c src/c2html.h src/highlighter.h
+	$(CC) -o $@ $(CFLAGS) -c $<
+
+build/highlighter.o: src/highlighter.c src/highlighter.h
 	$(CC) -o $@ $(CFLAGS) -c $<
 
 build:
 	$(MKDIR) $@
 	
 check: all
-	cd test && $(MAKE)
+	cd test && $(MAKE) -s
 	
 clean:
 	$(RMDIR) build

mercurial