|
nsz |
9b2923 |
CFLAGS+=-g -pipe -std=c99 -D_POSIX_C_SOURCE=200809L -Wall -Wno-unused-function -Wno-missing-braces
|
|
Szabolcs Nagy |
5625f7 |
CFLAGS+=-Wno-unknown-pragmas -fno-builtin -frounding-math -D_GNU_SOURCE
|
|
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 |
c58b8e |
#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
|
|
nsz |
9b2923 |
%: %.o
|
|
nsz |
9b2923 |
$(CC) $(LDFLAGS) -o $@ $^
|
|
Szabolcs Nagy |
2a4af1 |
|
|
Szabolcs Nagy |
2a4af1 |
.PRECIOUS: $(OBJ)
|