############################################################################ ## ## AnT 4.669 Makefile for user-defined systems ## ## 14.02.2004 Michael Schanz ## revised: 15.03.2004 by Georg Wackenhut ## Support to CYGWIN added! ;-) ## revised: 29.03.2004 by Viktor Avrutin and Michael Schanz ## revised: 06.05.2004 by Georg Wackenhut ## problem with 'test -e' under SolarisOS fixed ## ############################################################################ # The environment variable ANT_SYSTEM_NAME is required. # ${ANT_SYSTEM_NAME}.cpp has to be the implementation of your system. # If you have already set the environment variable ANT_SYSTEM_NAME # then you can simply use the make command line option -e (which # overrides the setting in this Makefile) without editing this # Makefile. Otherwise you have to edit the line below. ANT_SYSTEM_NAME = # ifeq (,${ANT_SYSTEM_NAME}) ANT_SYSTEM_FILE := $(shell find . -name '*' -prune -name '*.cpp' -exec egrep -l -e 'AnT.h' -e 'connectSystem' '{}' \;) ifeq (${ANT_SYSTEM_FILE},) $(warning No system file ($${ANT_SYSTEM_NAME}.cpp) found in the current directory!) ANT_SYSTEM_FILE = $(error ANT_SYSTEM_NAME undefined!) endif ifneq (,$(word 2, ${ANT_SYSTEM_FILE})) define WARNING $(shell echo) $(shell echo) $(shell echo " Ambiguous system file detection: ${ANT_SYSTEM_FILE}") $(shell echo " To disambiguate this just call:") $(shell echo) $(shell echo " make ANT_SYSTEM_NAME= [target]") $(shell echo) endef $(warning ${WARNING}) ANT_SYSTEM_NAME = $(error ANT_SYSTEM_NAME undefined!) else ANT_SYSTEM_NAME := $(shell basename ${ANT_SYSTEM_FILE} '.cpp') endif # endif ############################################################################ GCC = g++ INSTALL = install ANT_SHARED_LIB_EXT = `AnT --shared-lib-ext` ANT_SYSTEM_PATH = `AnT --installation-prefix`/lib/AnT/AnT-systems all : ${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT} build : ${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT} ${ANT_SYSTEM_NAME}.o : ${ANT_SYSTEM_NAME}.cpp ${GCC} -fPIC ${INCLUDES} \ -I"`AnT --installation-prefix`"/include/AnT/engine \ -c ${ANT_SYSTEM_NAME}.cpp ${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT} : ${ANT_SYSTEM_NAME}.o @if [ "x${ANT_SHARED_LIB_EXT}" = "xdll" ] ; then \ ${GCC} -shared -mno-cygwin -mms-bitfields \ -o ${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT} \ ${ANT_SYSTEM_NAME}.o -L"`AnT --installation-prefix`"/bin -lAnT ; \ else \ ${GCC} -shared -o ${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT} \ ${ANT_SYSTEM_NAME}.o ; \ fi ; install : ${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT} ${INSTALL} ${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT} \ ${ANT_SYSTEM_PATH}/${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT} .PHONY : uninstall clean uninstall : @if [ -f ${ANT_SYSTEM_PATH}/${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT} ] ; then \ rm -f ${ANT_SYSTEM_PATH}/${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT}; \ fi clean : @if [ -f ${ANT_SYSTEM_NAME}.o ] ; then \ rm -f ${ANT_SYSTEM_NAME}.o; \ fi @if [ -f ${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT} ] ; then \ rm -f ${ANT_SYSTEM_NAME}.${ANT_SHARED_LIB_EXT}; \ fi