diff options
author | Guenter Knauf <fuankg@apache.org> | 2011-03-04 11:19:49 +0000 |
---|---|---|
committer | Guenter Knauf <fuankg@apache.org> | 2011-03-04 11:19:49 +0000 |
commit | 00ab6bddb361a6cb256f009a30fb9d6d8447f4b2 (patch) | |
tree | cd076718704e819cbabbe42660f6301d14f444cd | |
parent | c16c739cb3b93b193e0e0763480ddf0c4c3b2e88 (diff) | |
download | apr-00ab6bddb361a6cb256f009a30fb9d6d8447f4b2.tar.gz |
NetWare build overhaul in order to compile on Linux.
Part 2.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1077882 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | NWGNUmakefile | 22 | ||||
-rw-r--r-- | build/NWGNUenvironment.inc | 44 | ||||
-rw-r--r-- | build/NWGNUhead.inc | 13 | ||||
-rw-r--r-- | build/NWGNUmakefile | 36 | ||||
-rw-r--r-- | build/NWGNUtail.inc | 42 |
5 files changed, 57 insertions, 100 deletions
diff --git a/NWGNUmakefile b/NWGNUmakefile index 69e267bae..aae431242 100644 --- a/NWGNUmakefile +++ b/NWGNUmakefile @@ -423,24 +423,24 @@ nlms :: libs $(TARGET_nlm) # correct place. (See $(APR_WORK)/build/NWGNUhead.inc for examples) # install :: nlms $(INSTDIRS) FORCE - $(CP) $(subst /,\,$(APR)\$(TARGET_nlm)) $(INSTALLBASE)\*.* + $(call CP,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/) ifndef DEST - -$(CP) $(subst /,\,$(APR))\STATUS $(INSTALLBASE)\*.apr - -$(CP) $(subst /,\,$(APR))\LICENSE $(INSTALLBASE)\* - -$(CP) $(subst /,\,$(APR))\CHANGES $(INSTALLBASE)\*.apr - @-$(XCP) $(subst /,\,$(APR))\docs $(INSTALLBASE)\docs\*.* + -$(call CP,$(APR)/STATUS,$(INSTALLBASE)/*.apr) + -$(call CP,$(APR)/LICENSE,$(INSTALLBASE)/) + -$(call CP,$(APR)/CHANGES,$(INSTALLBASE)/*.apr) + @-$(call XCP,$(APR)/docs,$(INSTALLBASE)/docs/) endif ifndef DEST installdev :: $(INSTDEVDIRS) FORCE - $(CP) $(subst /,\,$(APR))\include\*.h $(INSTALLBASE)\include\*.* - $(CP) $(subst /,\,$(APR))\*.imp $(INSTALLBASE)\lib\*.* - $(CP) $(subst /,\,$(APR))\misc\netware\*.xdc $(INSTALLBASE)\lib\*.* - $(CP) $(subst /,\,$(APR)\$(TARGET_lib)) $(INSTALLBASE)\lib\*.* - $(CP) $(subst /,\,$(APR)\$(TARGET_nlm)) $(INSTALLBASE)\bin\*.* + $(call CP,$(APR)/include/*.h,$(INSTALLBASE)/include/) + $(call CP,$(APR)/*.imp,$(INSTALLBASE)/lib/) + $(call CP,$(APR)/misc/netware/*.xdc,$(INSTALLBASE)/lib/) + $(call CP,$(APR)/$(TARGET_lib),$(INSTALLBASE)/lib/) + $(call CP,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/bin/) $(INSTDEVDIRS) :: - $(CHKNOT) $@\NUL mkdir $@ + $(call MD,$@) endif # diff --git a/build/NWGNUenvironment.inc b/build/NWGNUenvironment.inc index 44ef89b14..fd3e09f24 100644 --- a/build/NWGNUenvironment.inc +++ b/build/NWGNUenvironment.inc @@ -147,31 +147,27 @@ AWK = awk # Declare Command and tool macros here # -ifeq "$(OSTYPE)" "linux" -DEL = $(RM) -MD = mkdir -p -DELTREE = rmdir -p -CP = cp -av +ifeq ($(findstring /sh,$(SHELL)),/sh) +DEL = $(RM) $1 +MD = mkdir -p $1 +DELTREE = rm -rf $1 +CP = cp -av $1 $2 XCP = cp -ar -CHK = test -e -CHKNOT = test ! -e ECHONL = echo "" DL = ' else ifeq "$(OS)" "Windows_NT" CMD = cmd /c -DEL = del /q /f 2>NUL -DELTREE = rd /s /q 2>NUL +DEL = $(CMD) if exist $(subst /,\,$1) del /q /f 2>NUL $(subst /,\,$1) +DELTREE = rd /s /q 2>NUL $(subst /,\,$1) else CMD = command /c -DEL = del -DELTREE = deltree /y -endif -MD = md 2>NUL -CP = copy /y 2>NUL -XCP = xcopy /e /y 2>NUL -CHK = $(CMD) if exist -CHKNOT = $(CMD) if not exist +DEL = $(CMD) if exist $(subst /,\,$1) del 2>NUL $(subst /,\,$1) +DELTREE = deltree /y $(subst /,\,$1) +endif +MD = $(CMD) if not exist $(subst /,\,$1)\NUL md 2>NUL $(subst /,\,$1) +CP = copy /y 2>NUL $(subst /,\,$1) $(subst /,\,$2) +XCP = xcopy /e /y 2>NUL $(subst /,\,$1) $(subst /,\,$2) ECHONL = $(CMD) echo. endif @@ -269,15 +265,15 @@ endif endif ifndef INSTALL -INSTALL = $(APR_WORK)\Dist -INSTDIRS = $(APR_WORK)\Dist +INSTALL = $(APR_WORK)/Dist +INSTDIRS = $(APR_WORK)/Dist BASEDIR = Apr endif # Add support for building IPV6 alongside ifneq "$(IPV6)" "" DEFINES += -DNW_BUILD_IPV6 -# INCDIRS := $(NOVELLLIBC)\include\winsock\IPV6;$(INCDIRS) +# INCDIRS := $(NOVELLLIBC)/include/winsock/IPV6;$(INCDIRS) ifneq "$(findstring IPV6,$(OBJDIR))" "IPV6" OBJDIR := $(OBJDIR)_IPV6 @@ -301,14 +297,14 @@ endif endif -INSTALLBASE := $(INSTALL)\$(BASEDIR) +INSTALLBASE := $(INSTALL)/$(BASEDIR) INSTDEVDIRS := \ $(INSTDIRS) \ $(INSTALLBASE) \ - $(INSTALLBASE)\include \ - $(INSTALLBASE)\lib \ - $(INSTALLBASE)\bin + $(INSTALLBASE)/include \ + $(INSTALLBASE)/lib \ + $(INSTALLBASE)/bin INSTDIRS += \ $(INSTALLBASE) diff --git a/build/NWGNUhead.inc b/build/NWGNUhead.inc index 427e5ffe9..31b34e70b 100644 --- a/build/NWGNUhead.inc +++ b/build/NWGNUhead.inc @@ -86,13 +86,12 @@ FORCE : ; clean :: $(SUBDIRS) $(APRTEST) @echo Cleaning up $(CURDIR) - -$(DELTREE) $(OBJDIR) - $(CHK) *.err $(DEL) *.err - $(CHK) *.map $(DEL) *.map - $(CHK) *.d $(DEL) *.d - $(CHK) *.tmp $(DEL) *.tmp - -$(DELTREE) $(OBJDIR) + -$(call DELTREE,$(OBJDIR)) + $(call DEL,*.err) + $(call DEL,*.map) +# $(call DEL,*.d) + $(call DEL,*.tmp) $(OBJDIR) :: - -$(MD) $@ + $(call MD,$@) diff --git a/build/NWGNUmakefile b/build/NWGNUmakefile index fb6f1183d..a62e15d09 100644 --- a/build/NWGNUmakefile +++ b/build/NWGNUmakefile @@ -53,27 +53,15 @@ endif $(APR)/include/%.h: $(APR)/include/%.hnw @echo Creating $@ -ifeq "$(OSTYPE)" "linux" - $(CP) $< $@ -else - $(CP) $(subst /,\,$<) $(subst /,\,$@) -endif + $(call CP,$<,$@) $(APR)/include/private/%.h: $(APR)/include/private/%.hnw @echo Creating $@ -ifeq "$(OSTYPE)" "linux" - $(CP) $< $@ -else - $(CP) $(subst /,\,$<) $(subst /,\,$@) -endif + $(call CP,$<,$@) $(APR)/include/private/%.h: $(APR)/include/private/%.hw @echo Creating $@ -ifeq "$(OSTYPE)" "linux" - $(CP) $< $@ -else - $(CP) $(subst /,\,$<) $(subst /,\,$@) -endif + $(call CP,$<,$@) $(APR)/include/private/apu_config.h: FORCE @@ -85,15 +73,15 @@ install :: nlms FORCE clean :: - $(CHK) nw_export.i $(DEL) nw_export.i - $(CHK) $(NLM_NAME)_cc.opt $(DEL) $(NLM_NAME)_cc.opt - $(CHK) NWGNUversion.inc $(DEL) NWGNUversion.inc - $(CHK) $(subst /,\,$(APR))\include\apr.h $(DEL) $(subst /,\,$(APR))\include\apr.h - $(CHK) $(subst /,\,$(APR))\include\apu_want.h $(DEL) $(subst /,\,$(APR))\include\apu_want.h - $(CHK) $(subst /,\,$(APR))\include\apr_ldap.h $(DEL) $(subst /,\,$(APR))\include\apr_ldap.h - $(CHK) $(subst /,\,$(APR))\include\private\apu_config.h $(DEL) $(subst /,\,$(APR))\include\private\apu_config.h - $(CHK) $(subst /,\,$(APR))\include\private\apu_select_dbm.h $(DEL) $(subst /,\,$(APR))\include\private\apu_select_dbm.h - $(CHK) $(subst /,\,$(APR))\aprlib.imp $(DEL) $(subst /,\,$(APR))\aprlib.imp + $(call DEL,nw_export.i) + $(call DEL,$(NLM_NAME)_cc.opt) + $(call DEL,NWGNUversion.inc) + $(call DEL,$(APR)/include/apr.h) + $(call DEL,$(APR)/include/apu_want.h) + $(call DEL,$(APR)/include/apr_ldap.h) + $(call DEL,$(APR)/include/private/apu_config.h) + $(call DEL,$(APR)/include/private/apu_select_dbm.h) + $(call DEL,$(APR)/aprlib.imp) # # Include the 'tail' makefile that has targets that depend on variables defined diff --git a/build/NWGNUtail.inc b/build/NWGNUtail.inc index 60215b6f5..3aa79e954 100644 --- a/build/NWGNUtail.inc +++ b/build/NWGNUtail.inc @@ -118,11 +118,7 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/$(CCOPT_NAME)_cc.opt $(CC) -o $@ $< @$(word 2, $^) $(OBJDIR)/$(CCOPT_NAME)_cc.opt: $(CCOPT_DEPENDS) -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) -endif + $(call DEL,$@) # @echo CCOPT_DEPENDS=$^ # @echo Generating $@ @echo GEN $@ @@ -151,11 +147,7 @@ $(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(CCOPT_NAME)_cpp.opt $(CCP) -o $@ $< @$(word 2, $^) $(OBJDIR)/$(CCOPT_NAME)_cpp.opt: $(CPPOPT_DEPENDS) -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) -endif + $(call DEL,$@) @echo CPPOPT_DEPENDS=$^ # @echo Generating $@ @echo GEN $@ @@ -189,21 +181,13 @@ endif # one target nlm or lib ifeq "$(words $(strip $(TARGET_lib)))" "1" $(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) -endif + $(call DEL,$@) # @echo Generating $@ @echo AR $@ $(LIB) -o $@ @$< $(OBJDIR)/aprlib_lib.lst: $(aprlib_LIBLST_DEPENDS) -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) -endif + $(call DEL,$@) ifneq "$(strip $(FILES_lib_objs))" "" # @echo Generating $@ @echo GEN $@ @@ -221,11 +205,7 @@ ifneq "$(strip $(FILES_lib_objs))" "" endif $(OBJDIR)/%_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS) -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) -endif + $(call DEL,$@) ifneq "$(strip $(FILES_lib_objs))" "" # @echo Generating $@ @echo GEN $@ @@ -258,13 +238,8 @@ $(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.o # corresponding makefile $(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS) -ifeq "$(OSTYPE)" "linux" - $(DEL) $@ - $(DEL) $(@:.opt=.def) -else - $(CHK) $(subst /,\,$@) $(DEL) $(subst /,\,$@) - $(CHK) $(subst /,\,$(@:.opt=.def)) $(DEL) $(subst /,\,$(@:.opt=.def)) -endif + $(call DEL,$@) + $(call DEL,$(@:.opt=.def)) # @echo Generating $@ @echo GEN $@ @echo -warnings off >> $@ @@ -383,7 +358,6 @@ endif # NO_LICENSE_FILE endif # multiple targets $(INSTDIRS) :: -# $(CHKNOT) $@\NUL mkdir $@ - -$(MD) $@ + $(call MD,$@) |