# Generic Makefile to run tests of one or more programs # Last edited on 2017-07-28 21:28:56 by jstolfi ###################################################################### # To be included by the top-level Makefile in the program's directory. # The caller must define # # ${STOLFIHOME} directory with stolfi's bin, lib, include, etc. # ${PROGDIR} dir containing the executable program to be tested and its sources # ${PROG} or ${PROGS} names of script to test (WITHOUT dir but with extension) # # The client must define the "all", "run", and "clean" targets. include ${STOLFIHOME}/programs/c/GENERIC.make ifeq "/${PROGS}" "/" PROGS := ${PROG} endif ifneq "/${PROGS}" "/" ifneq "/${PROGDIR}" "/" # ---------------------------------------------------------------------- # Locations of imported packages # Location of Stolfi's headers and libraries: JS_PUB_DIR := ${STOLFIHOME} JS_LIB_DIR := ${JS_PUB_DIR}/lib/${PLATFORM} #--------------------------------------------------------------------- # Default target for "make" with no target: all: check #--------------------------------------------------------------------- # "make actions" performs the ${ACTIONS} locally: actions: ifeq "/${ACTIONS}" "/" @echo '$${ACTIONS} is empty' else ${MAKE} ${ACTIONS} endif #--------------------------------------------------------------------- # "make build" are no-ops for scripts: build: build-progs build-tests: build-progs build-progs: #--------------------------------------------------------------------- # "make install" is a no-op: install: #--------------------------------------------------------------------- # "make uninstall" is a no-op: uninstall: #--------------------------------------------------------------------- # "make clean" deletes all derived files. # It is a double-colon rule so that clients may add more actions. clean:: endif endif # End of ${PROG} ${PROGDIR} section. ###################################################################### #--------------------------------------------------------------------- # "make debug" prints some debugging info: debug: @echo "PROG = ${PROG}" @echo "PROGS = ${PROGS}" @echo "PROG_DIR = ${PROG_DIR}"