# Makefile for a directory with several library source sub-directories # Last edited on 2008-01-14 19:21:45 by stolfi ######################################################################## # Client must define ${LIBS} (list of library source sub-directories) # and ${PLATFORM} (platform for installation directories, e.g. # "i686-Linux-2.2" ###################################################################### # In case the ${PLATFORM} variable is not set: ifeq "/${PLATFORM}" "/" all: @echo "the PLATFORM variable is undefined" endif # ###################################################################### ###################################################################### # In case the ${LIBS} variable is not set: ifeq "/${LIBS}" "/" all: @echo "the LIBS variable is undefined" endif # ###################################################################### ifneq "/${LIBS}" "/" ifneq "/${PLATFORM}" "/" # User's global repositories: INST_LIB_DIR := ${HOME}/PUB/lib/${PLATFORM} INST_INC_DIR := ${HOME}/PUB/include INST_BIN_DIR := ${HOME}/PUB/bin/${PLATFORM} INST_LSP_DIR := ${HOME}/PUB/lisp/lib .PHONY: all setup depend clean uninstall install archive check # all: setup clean # all: setup clean uninstall install # all: setup clean uninstall install check # all: setup uninstall install all: setup install uninstall: @for f in ${LIBS}; do \ ( cd $$f && make uninstall; ) \ done install: @for f in ${LIBS}; do \ ( cd $$f && make install; ) \ done clean: @for f in ${LIBS}; do \ ( cd $$f && make clean ; ) \ done check: @for f in ${LIBS}; do \ ( cd $$f && make check ; ) \ done archive: @for f in ${LIBS}; do \ ( cd $$f && make archive ; ) \ done #depend: @for f in ${LIBS}; do \ ( cd $$f && make depend ; ) \ done ---------------------------------------------------------------------- # "make setup" creates the user's global installation directories setup: \ ${INST_INC_DIR} \ ${INST_LIB_DIR} \ ${INST_LSP_DIR} \ ${INST_BIN_DIR} \ ${INST_BIN_DIR}/extract-ho-deps ${INST_INC_DIR}: mkdir -pv ${INST_INC_DIR} ${INST_LIB_DIR}: mkdir -pv ${INST_LIB_DIR} ${INST_BIN_DIR}: mkdir -pv ${INST_BIN_DIR} ${INST_LSP_DIR}: mkdir -pv ${INST_LSP_DIR} # ---------------------------------------------------------------------- # Make sure that the script {extract-ho-deps} is i the ${INST_BIN_DIR} directory: ${INST_BIN_DIR}/extract-ho-deps: ${INST_BIN_DIR} extract-ho-deps cp -pv extract-ho-deps ${INST_BIN_DIR} endif endif # end of ${LIBS} ${PLATFORM} section ######################################################################