commit b76435c83bed126c9bab3767692545004659f469 parent b9bb0ef69ee533b953921073086807e759879312 Author: gearsix <gearsix@tuta.io> Date: Sat, 13 Nov 2021 14:21:55 +0000 suped up Makefile Diffstat:
M | Makefile | | | 28 | ++++++++++++++++++++++++---- |
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,4 +1,24 @@ -all: - ${CC} -o txt2html txt2html.c node.c parse.c rules.c -debug: - ${CC} -g -o txt2html-debug txt2html.c node.c parse.c rules.c +CC = gcc +CFLAGS = -pedantic -Wall -Wextra -Werror +SRC = $(wildcard *.c) +OBJ = $(SRC:.c=.o) +OUT = txt2html + +all: $(OUT) + +debug: clean +debug: CFLAGS += -g +debug: OUT = txt2html-debug +debug: $(OUT) + + +$(OUT): $(OBJ) + $(CC) -o $(OUT) $(OBJ) + +$(OBJ): $(SRC) + $(CC) $(CFLAGS) -c $(SRC) + + +.PHONY: clean +clean: + rm -f $(OBJ) $(OUT) $(OUT)-debug