target.mk 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#################################################################################
#
#			target.mk
#
#		nofib standard target rules
#
#################################################################################


# Only do this in leaf directories (important, this)
ifeq "$(SUBDIRS)" ""
all ::
	@echo HC = $(HC)
	@echo HC_OPTS = $(HC_OPTS)
	@echo RUNTEST_OPTS = $(RUNTEST_OPTS)


all :: runtests
endif

$(NOFIB_PROG) : $(OBJS)
	@echo ==nofib== $(NOFIB_PROG): time to link $(NOFIB_PROG) follows...
	@$(TIME) $(HC) $(HC_OPTS) -o $@ $^ $(LIBS)
sof's avatar
sof committed
24 25 26 27 28
	@if (test -f $@ ); then \
		$(STRIP) $@; \
		echo ==nofib== $(NOFIB_PROG): size of $(NOFIB_PROG) follows...; \
		$(SIZE) $@; \
	fi;
29

sof's avatar
sof committed
30
ifneq "$(NOFIB_PROG)" ""
31 32 33 34 35 36 37
runtests :: $(NOFIB_PROG)
	@echo ==nofib== $<: time to run $< follows...
	@$(TIME) $(RUNTEST) ./$< \
	  $(addprefix -i ,$(wildcard $(NOFIB_PROG).stdin)) \
	  $(addprefix -o1 ,$(wildcard $(NOFIB_PROG).stdout)) \
	  $(addprefix -o2 ,$(wildcard $(NOFIB_PROG).stderr)) \
	  $(RUNTEST_OPTS)
sof's avatar
sof committed
38 39 40 41
else
runtests ::
	@:
endif
42 43 44 45 46 47

# Include standard boilerplate
# We do this at the end for cosmetic reasons: it means that the "normal-way"
# runtests will precede the "other-way" recursive invocations of make

include $(FPTOOLS_TOP)/mk/target.mk