target.mk 1.91 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#################################################################################
#
#			target.mk
#
#		nofib standard target rules
#
#################################################################################


# Only do this in leaf directories (important, this)
sof's avatar
sof committed
11 12 13 14 15 16 17

nofib-dist-pre::
	-rm -rf $(SRC_DIST_DIR)
	-rm -f $(SRC_DIST_NAME).tar.gz
	(cd $(FPTOOLS_TOP_ABS)/nofib; find $(SRC_DIST_DIRS) -type d \( -name CVS -prune -o -name SRC -prune -o -name tests -prune -o -exec $(MKDIRHIER) $(SRC_DIST_DIR)/{} \; \) ; )
	(cd $(FPTOOLS_TOP_ABS)/nofib; find $(SRC_DIST_DIRS) -name CVS -prune -o -name SRC -prune -o -name tests -prune -o -name "*~" -prune -o -name ".cvsignore" -prune -o -type l -exec $(LN_S) $(FPTOOLS_TOP_ABS)/nofib/{} $(SRC_DIST_DIR)/{} \; )

18 19 20 21 22 23 24 25 26 27
ifeq "$(SUBDIRS)" ""
all ::
	@echo HC = $(HC)
	@echo HC_OPTS = $(HC_OPTS)
	@echo RUNTEST_OPTS = $(RUNTEST_OPTS)


all :: runtests
endif

sof's avatar
sof committed
28 29
# Bogosity needed here to cope with .exe suffix for strip & size files.
# (shouldn't have to be our problem.)
sof's avatar
sof committed
30
ifneq "$(HC_FAIL)" "YES"
31 32 33
$(NOFIB_PROG) : $(OBJS)
	@echo ==nofib== $(NOFIB_PROG): time to link $(NOFIB_PROG) follows...
	@$(TIME) $(HC) $(HC_OPTS) -o $@ $^ $(LIBS)
sof's avatar
sof committed
34
endif
35

sof's avatar
sof committed
36
ifneq "$(NOFIB_PROG)" ""
37 38 39 40 41 42
size :: $(NOFIB_PROG)
	@$(STRIP) $(NOFIB_PROG)$(exeext)
	@echo ==nofib== $(NOFIB_PROG): size of $(NOFIB_PROG) follows...
	@$(SIZE) $(NOFIB_PROG)$(exeext)

runtests :: $(NOFIB_PROG) size
43 44
	@echo ==nofib== $<: time to run $< follows...
	@$(TIME) $(RUNTEST) ./$< \
sof's avatar
sof committed
45
	  $(addprefix -i ,$(wildcard $(subst $(_way),,$(NOFIB_PROG)).stdin)) \
46 47
	  $(addprefix -o1 ,$(wildcard $(subst $(_way),,$(NOFIB_PROG)).stdout*)) \
	  $(addprefix -o2 ,$(wildcard $(subst $(_way),,$(NOFIB_PROG)).stderr*)) \
48
	  $(RUNTEST_OPTS)
sof's avatar
sof committed
49
else
50 51
size ::
	@:
sof's avatar
sof committed
52 53 54
runtests ::
	@:
endif
55 56 57 58 59 60

# 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