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:
parent
5e1d6ae207
commit
dd2655db0c
8
Makefile
8
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 $@ $<
|
||||
|
|
Loading…
Reference in New Issue