math/scalb* max scale test cases
[libc-test] / Makefile
index f339aff..dc0b6f2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,10 +4,11 @@ OBJS:=$(SRCS:src/%.c=$(B)/%.o)
 DIRS:=$(patsubst src/%/,%,$(sort $(dir $(SRCS))))
 BDIRS:=$(DIRS:%=$(B)/%)
 NAMES:=$(SRCS:src/%.c=%)
-CFLAGS:=-Isrc/common
+CFLAGS:=-Isrc/common -I$(B)/common
 LDLIBS:=$(B)/common/libtest.a
 AR = $(CROSS_COMPILE)ar
 RANLIB = $(CROSS_COMPILE)ranlib
+RUN_TEST = $(RUN_WRAP) $(B)/common/runtest
 
 all:
 %.mk:
@@ -97,18 +98,21 @@ $(OBJS): src/common/test.h | $(BDIRS)
 $(BDIRS):
        mkdir -p $@
 
+$(B)/common/options.h: src/common/options.h.in
+       $(CC) -E - <$< | sed -e '1,/optiongroups_unistd_end/d' -e '/^#/d' -e '/^[[:space:]]*$$/d' -e 's/^/#define /' >$@
+
 $(B)/common/mtest.o: src/common/mtest.h
 $(math.OBJS): src/common/mtest.h
 
 $(B)/api/main: $(api.OBJS)
 api/main.OBJS:=$(api.OBJS)
+$(api.OBJS):$(B)/common/options.h
 $(api.OBJS):CFLAGS+=-pedantic-errors -Werror -Wno-unused -D_XOPEN_SOURCE=700
-$(api.OBJS):CFLAGS+=-DX_PS -DX_TPS -DX_SS
 
 all:$(B)/REPORT
 run:$(B)/REPORT
 clean:
-       rm -f $(OBJS) $(BINS) $(LIBS) $(B)/common/libtest.a $(B)/common/runtest $(B)/*/*.err
+       rm -f $(OBJS) $(BINS) $(LIBS) $(B)/common/libtest.a $(B)/common/runtest $(B)/common/options.h $(B)/*/*.err
 cleanall: clean
        rm -f $(B)/REPORT $(B)/*/REPORT
 $(B)/REPORT:
@@ -136,7 +140,7 @@ $(B)/%: $(B)/%.o
 %.ld.err: %
        touch $@
 %.err: %
-       $(B)/common/runtest ./$< >$@ || true
+       $(RUN_TEST) ./$< >$@ || true
 
 .PHONY: all run clean cleanall