X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=Makefile;h=13ed2cb0e84de96de2991069aab911062e8b0290;hb=dfe1da9485ec22fb335d97de1421ef717aa6f45e;hp=f339aff6dcc653d521cdc362c72532e516346477;hpb=beb27269aef47413b4b32a18709f104681ffedeb;p=libc-test diff --git a/Makefile b/Makefile index f339aff..13ed2cb 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,15 @@ B:=src SRCS:=$(sort $(wildcard src/*/*.c)) OBJS:=$(SRCS:src/%.c=$(B)/%.o) +LOBJS:=$(SRCS:src/%.c=$(B)/%.lo) 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 -w '$(RUN_WRAP)' all: %.mk: @@ -77,7 +79,7 @@ $(B)/$(1)/run: $(B)/$(1)/cleanerr $(B)/$(1)/REPORT $(B)/$(1)/cleanerr: rm -f $$(filter-out $(B)/$(1)/%-static.err,$$($(1).ERRS)) $(B)/$(1)/clean: - rm -f $$(filter $(B)/$(1)/%,$$(OBJS) $$(BINS) $$(LIBS)) $(B)/$(1)/*.err + rm -f $$(filter $(B)/$(1)/%,$$(OBJS) $$(LOBJS) $$(BINS) $$(LIBS)) $(B)/$(1)/*.err $(B)/$(1)/REPORT: $$($(1).ERRS) cat $(B)/$(1)/*.err >$$@ run: $(B)/$(1)/run @@ -91,24 +93,29 @@ $(B)/common/libtest.a: $(common.OBJS) $(AR) rc $@ $^ $(RANLIB) $@ +$(B)/common/all: $(B)/common/runtest + $(ERRS): $(B)/common/runtest | $(BDIRS) $(BINS) $(LIBS): $(B)/common/libtest.a $(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 +143,7 @@ $(B)/%: $(B)/%.o %.ld.err: % touch $@ %.err: % - $(B)/common/runtest ./$< >$@ || true + $(RUN_TEST) ./$< >$@ || true .PHONY: all run clean cleanall