# Generic Makefile for one or more self-contained scripts (awk, bask, etc.) # Last edited on 2016-12-26 21:41:13 by stolfilocal ###################################################################### # To be included by the top-level Makefile in the program's directory. # The caller must define # # ${PROG} or ${PROGS} user-executable scripts. # ${LIB} or ${LIBS} auxiliary script files used by the above (WITH extensions). include GENERIC.make ifeq "/${PROGS}" "/" PROGS := ${PROG} endif ifeq "/${LIBS}" "/" LIBS := ${LIB} endif ifneq "/${PROGS}${LIBS}" "/" #--------------------------------------------------------------------- # Default action for "make" with no arguments: # # all: clean build check all: build #--------------------------------------------------------------------- # "make actions" performs the actions listed in ${ACTIONS}, if any actions: ifeq "/${ACTIONS}" "/" @echo '$${ACTIONS} is empty' else ${MAKE} ${ACTIONS} endif #--------------------------------------------------------------------- # "make depend" does nothing depend: #--------------------------------------------------------------------- # "make build" does nothing (for now): build: ${PROGS} ${LIBS} build-libs: ${LIBS} build-progs: ${PROGS} ${LIBS} build-tests: ${PROGS} ${LIBS} if [[ -d ${TEST_DIR} ]]; then ( cd ${TEST_DIR} && ${MAKE} build ) fi #--------------------------------------------------------------------- # "make check" runs the tests in the "tests" subdirectory. TEST_DIR := tests check: ${PROG} if [[ -d ${TEST_DIR} ]]; then ( cd ${TEST_DIR} && ${MAKE} all ) fi #--------------------------------------------------------------------- # "make clean" deletes all derived files. clean: -/bin/rm -f core if [[ -d ${TEST_DIR} ]]; then ( cd ${TEST_DIR} && ${MAKE} clean ) fi endif # End of ${PROGS}/${LIBS} section. ###################################################################### #--------------------------------------------------------------------- # "make debug" prints some debugging info: debug: @echo "PROGS = ${PROGS}" @echo "LIBS = ${LIBS}"