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.
This commit is contained in:
Zorchenhimer 2021-07-14 11:32:46 -04:00
parent 5e1d6ae207
commit dd2655db0c
1 changed files with 2 additions and 6 deletions

View File

@ -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 $@ $<