1# 2# Obtain the global build environment 3# 4 5include $(APR_WORK)/build/NWGNUenvironment.inc 6 7# 8# Define base targets and rules 9# 10 11TARGETS = libs nlms install clobber_libs clobber_nlms clean installdev 12 13.PHONY : $(TARGETS) default all help $(NO_LICENSE_FILE) 14 15# Here is where we will use the NO_LICENSE_FILE variable to see if we need to 16# restart the make with it defined 17 18ifdef NO_LICENSE_FILE 19 20default: NO_LICENSE_FILE 21 22all: NO_LICENSE_FILE 23 24install :: NO_LICENSE_FILE 25 26installdev :: NO_LICENSE_FILE 27 28NO_LICENSE_FILE : 29 $(MAKE) $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(METROWERKS)/license.dat" 30 31else # LM_LICENSE_FILE must be defined so use the real targets 32 33default: $(SUBDIRS) libs nlms 34 35all: $(SUBDIRS) libs nlms install 36 37$(TARGETS) :: $(SUBDIRS) 38 39endif #NO_LICENSE_FILE check 40 41help : 42 @echo $(DL)targets for RELEASE=$(RELEASE):$(DL) 43 @echo $(DL)(default) . . . . libs nlms$(DL) 44 @echo $(DL)all . . . . . . . does everything (libs nlms install)$(DL) 45 @echo $(DL)libs. . . . . . . builds all libs$(DL) 46 @echo $(DL)nlms. . . . . . . builds all nlms$(DL) 47 @echo $(DL)install . . . . . builds libs and nlms and copies install files to$(DL) 48 @echo $(DL) "$(INSTALL)"$(DL) 49 @echo $(DL)installdev. . . . copies headers and files needed for development to$(DL) 50 @echo $(DL) "$(INSTALL)"$(DL) 51 @echo $(DL)clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map$(DL) 52 @echo $(DL)clobber_all . . . deletes all possible output from the make$(DL) 53 @echo $(DL)clobber_install . deletes all files in $(INSTALL)$(DL) 54 @$(ECHONL) 55 @echo $(DL)Multiple targets can be used on a single make command line -$(DL) 56 @echo $(DL)(i.e. $(MAKE) clean all)$(DL) 57 @$(ECHONL) 58 @echo $(DL)You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=release$(DL) 59 @echo $(DL)The default is RELEASE=release$(DL) 60 61clobber_all :: clean clobber_install 62 63clobber_install :: 64 $(call RMDIR,$(INSTALL)) 65 66# 67# build recursive targets 68# 69 70$(SUBDIRS) : FORCE 71ifneq "$(MAKECMDGOALS)" "clean" 72ifneq "$(findstring clobber_,$(MAKECMDGOALS))" "clobber_" 73 @$(ECHONL) 74 @echo Building $(CURDIR)/$@ 75endif 76endif 77 $(MAKE) -C $@ $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(LM_LICENSE_FILE)" 78 @$(ECHONL) 79 80FORCE : ; 81 82# 83# Standard targets 84# 85 86clean :: $(SUBDIRS) $(APRTEST) 87 @echo Cleaning up $(CURDIR) 88 $(call RMDIR,$(OBJDIR)) 89 $(call DEL,*.err) 90 $(call DEL,*.map) 91 $(call DEL,*.tmp) 92# $(call DEL,*.d) 93 94$(OBJDIR) :: 95 $(call MKDIR,$@) 96 97