From dd2655db0c3267d71490c33a158240b9476bb51a Mon Sep 17 00:00:00 2001 From: Zorchenhimer Date: Wed, 14 Jul 2021 11:32:46 -0400 Subject: [PATCH] Fix Makefile for use on Unix The GCC version installed on Unix does not support `-Wpedantic`, so this has been replaced with `-pedantic`. The version installed on Unix is 4.0.0. `.PHONY` has been removed as this has no special meaning on Unix. Instead, make thought it was a target which made it build, run, then immediately delete the executable. This is obviously not desired. Unix make also doesn't support the `$^` automatic variable. This has been replaced with the object list variable instead. --- Makefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 45b72f7..7cca081 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ -.PHONY: run test run clean CC=gcc -CFLAGS=-Wall -Wpedantic -Werror -std=c99 +CFLAGS=-Wall -pedantic -Werror -std=c99 OBJ=main.o lexer.o token.o node.o @@ -11,10 +10,7 @@ run: readme ./readme readme: ${OBJ} - ${CC} ${CFLAGS} -o $@ $^ - -#token.o: token.h token.c -# ${CC} ${CFLAGS} -o $@ $< + ${CC} ${CFLAGS} -o $@ ${OBJ} .c.o: ${CC} ${CFLAGS} -c -o $@ $<