X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fapi%2FMakefile;h=a739442684723f4d2f8f4f57ee054884b0d6ec33;hb=3feaa322fdec8f8a45ec19a260103f11a12891e3;hp=50dfdd7d24dd24fb5afe87dd3ff50e0439cc42e2;hpb=522e481aa536f70534dd1a4fa6cf23988bd9ef15;p=libc-test diff --git a/src/api/Makefile b/src/api/Makefile index 50dfdd7..a739442 100644 --- a/src/api/Makefile +++ b/src/api/Makefile @@ -1,12 +1,25 @@ CFLAGS+=-std=c99 -pedantic-errors -Wall -Werror -Wno-unused -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -#CFLAGS+=-DX_PS -DX_TPS -DX_TYM -DX_RPP_TPP +#CFLAGS+=-DX_PS -DX_TPS -DX_TYM -DX_RPP_TPP -DX_FMTMSG -DX_NDBM +LDFLAGS+=-lcrypt -ldl -lm -lpthread -lrt -all: - for i in *.c; do \ - LC_ALL=C $(CC) $(CFLAGS) -c $$i 2>&1; \ - done |grep -v 'Each undeclared identifier is reported only once' |grep -v 'for each function it appears in' - $(CC) $(LDFLAGS) -lcrypt -ldl -lm -lpthread -lrt *.o -o main +SRC=$(sort $(wildcard *.c)) +ERR=$(SRC:.c=.err) -clean: - rm -f main *.o +-include ../../config.mak + +all: all.err + +run: all.err + cat $< +all.err: $(ERR) + LC_ALL=C $(CC) $(LDFLAGS) -o main *.o 2>main.err || true + cat $(ERR) |\ + grep -v 'Each undeclared identifier is reported only once' |\ + grep -v 'for each function it appears in' >$@ || true + +%.err: %.c + LC_ALL=C $(CC) $(CFLAGS) -c $< 2>$@ || true + +clean: + rm -f main *.o *.err