|
nsz |
9b2923 |
CFLAGS+=-g -pipe -std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Wno-unused-function -Wno-missing-braces
|
|
Szabolcs Nagy |
db4b6c |
CFLAGS+=-Wno-unknown-pragmas -fno-builtin -frounding-math
|
|
Szabolcs Nagy |
db4b6c |
CFLAGS+=-D_GNU_SOURCE -O0
|
|
nsz |
9b2923 |
LDFLAGS+=-g -lm
|
|
nsz |
9b2923 |
|
|
nsz |
9b2923 |
SRC=$(sort $(wildcard *.c))
|
|
nsz |
9b2923 |
OBJ=$(SRC:.c=.o)
|
|
nsz |
9b2923 |
BINOBJ=$(filter-out util.o,$(OBJ))
|
|
nsz |
9b2923 |
BIN=$(BINOBJ:.o=)
|
|
nsz |
9b2923 |
|
|
Szabolcs Nagy |
db4b6c |
-include ../../config.mak
|
|
nsz |
9b2923 |
|
|
nsz |
9b2923 |
all: $(BIN)
|
|
nsz |
9b2923 |
run: all
|
|
nsz |
9b2923 |
@N=0; for i in $(BIN);do ./$$i || N=$$((N+1)); done; [ "$$N" = 0 ] && echo PASS || echo FAILS: $$N
|
|
nsz |
9b2923 |
clean:
|
|
nsz |
9b2923 |
rm -f $(OBJ) $(BIN)
|
|
nsz |
9b2923 |
|
|
nsz |
f9d179 |
$(BIN): util.o
|
|
Szabolcs Nagy |
2a4af1 |
$(OBJ): util.h
|
|
Szabolcs Nagy |
2a4af1 |
%.o: %.c
|
|
nsz |
9b2923 |
$(CC) $(CFLAGS) -c -o $@ $<
|
|
nsz |
9b2923 |
%: %.c
|
|
Szabolcs Nagy |
db4b6c |
|
|
nsz |
9b2923 |
%: %.o
|
|
nsz |
9b2923 |
$(CC) $(LDFLAGS) -o $@ $^
|
|
Szabolcs Nagy |
2a4af1 |
|
|
Szabolcs Nagy |
2a4af1 |
.PRECIOUS: $(OBJ)
|