00001 # 00002 # Obtain the global build environment 00003 # 00004 00005 include $(AP_WORK)\build\NWGNUenvironment.inc 00006 00007 # 00008 # Define base targets and rules 00009 # 00010 00011 TARGETS = libs nlms install clobber_libs clobber_nlms clean installdev 00012 00013 .PHONY : $(TARGETS) default all help $(NO_LICENSE_FILE) 00014 00015 # Here is where we will use the NO_LICENSE_FILE variable to see if we need to 00016 # restart the make with it defined 00017 00018 ifdef NO_LICENSE_FILE 00019 00020 default: NO_LICENSE_FILE 00021 00022 all: NO_LICENSE_FILE 00023 00024 install :: NO_LICENSE_FILE 00025 00026 installdev :: NO_LICENSE_FILE 00027 00028 NO_LICENSE_FILE : 00029 $(MAKE) $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(METROWERKS)\license.dat" 00030 00031 else # LM_LICENSE_FILE must be defined so use the real targets 00032 00033 default: $(SUBDIRS) libs nlms 00034 00035 all: $(SUBDIRS) libs nlms install 00036 00037 $(TARGETS) :: $(SUBDIRS) 00038 00039 install :: nlms $(INSTDIRS) 00040 00041 installdev :: $(INSTDEVDIRS) 00042 00043 $(INSTDIRS) :: 00044 $(CHKNOT) $@\NUL mkdir $@ 00045 00046 $(INSTDEVDIRS) :: 00047 $(CHKNOT) $@\NUL mkdir $@ 00048 00049 endif #NO_LICENSE_FILE check 00050 00051 help : 00052 @echo targets for RELEASE=$(RELEASE): 00053 @echo (default) . . . . libs nlms 00054 @echo all . . . . . . . does everything (libs nlms install) 00055 @echo libs. . . . . . . builds all libs 00056 @echo nlms. . . . . . . builds all nlms 00057 @echo install . . . . . builds libs and nlms and copies install files to 00058 @echo "$(INSTALL)" 00059 @echo installdev. . . . copies headers and files needed for development to 00060 @echo "$(INSTALL)" 00061 @echo clean . . . . . . deletes $(OBJDIR) dirs, *.err, and *.map 00062 @echo clobber_all . . . deletes all possible output from the make 00063 @echo clobber_install . deletes all files in $(INSTALL) 00064 @$(CMD) echo. 00065 @echo Multiple targets can be used on a single nmake command line - 00066 @echo (i.e. $(MAKE) clean all) 00067 @$(CMD) echo. 00068 @echo You can also specify RELEASE=debug, RELEASE=noopt, or RELEASE=optimized 00069 @echo The default is RELEASE=optimized 00070 00071 clobber_all :: clean clobber_install clobber_prebuild 00072 00073 clobber_install :: 00074 -$(DELTREE) $(INSTALL) 2>NUL 00075 00076 clobber_prebuild :: 00077 $(CHK) $(PREBUILD_INST)\*.* $(DEL) $(PREBUILD_INST)\*.* 00078 -$(DELTREE) $(PREBUILD_INST) 2> NUL 00079 00080 # 00081 # build recursive targets 00082 # 00083 00084 $(SUBDIRS) : FORCE 00085 ifneq "$(MAKECMDGOALS)" "clean" 00086 $(CMD) echo. 00087 @echo Building $(CURDIR)/$@ 00088 endif 00089 $(MAKE) -C $@ $(MAKECMDGOALS) -f NWGNUmakefile RELEASE=$(RELEASE) DEST="$(INSTALL)" LM_LICENSE_FILE="$(LM_LICENSE_FILE)" 00090 $(CMD) echo. 00091 00092 FORCE: 00093 00094 # 00095 # Standard targets 00096 # 00097 00098 clean :: $(SUBDIRS) 00099 @echo Cleaning up $(CURDIR) 00100 -$(DELTREE) $(OBJDIR) 2> NUL 00101 $(CHK) *.err $(DEL) *.err 00102 $(CHK) *.map $(DEL) *.map 00103 $(CHK) *.d $(DEL) *.d 00104 $(CHK) *.tmp $(DEL) *.tmp 00105 $(CHK) xc.bat $(DEL) xc.bat 00106 -$(DELTREE) $(OBJDIR) 2> NUL 00107 00108 $(OBJDIR) :: 00109 $(CHKNOT) $(OBJDIR)\nul mkdir $(OBJDIR) 00110