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
$(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: