#
# This contains final targets and should be included at the end of any
# NWGNUmakefile file
#
#
# If we are going to create an nlm, make sure we have assigned variables to
# use during the link.
#
ifndef NLM_NAME
NLM_NAME = $(TARGET_nlm)
endif
ifndef NLM_DESCRIPTION
NLM_DESCRIPTION = $(NLM_NAME)
endif
ifndef NLM_THREAD_NAME
NLM_THREAD_NAME = $(NLM_NAME) Thread
endif
ifndef NLM_SCREEN_NAME
NLM_SCREEN_NAME = DEFAULT
endif
ifndef NLM_COPYRIGHT
NLM_COPYRIGHT = Licensed under the Apache License, Version 2.0
endif
ifeq "$(NLM_FLAGS)" ""
NLM_FLAGS = AUTOUNLOAD, PSEUDOPREEMPTION
endif
ifeq "$(NLM_STACK_SIZE)" ""
NLM_STACK_SIZE = 65536
endif
ifeq "$(NLM_ENTRY_SYM)" ""
NLM_ENTRY_SYM = _LibCPrelude
endif
ifeq "$(NLM_EXIT_SYM)" ""
NLM_EXIT_SYM = _LibCPostlude
endif
ifeq "$(NLM_VERSION)" ""
NLM_VERSION = $(VERSION)
endif
#
# Create dependency lists based on the files available
#
STANDARD_DEPENDS = \
$(CUSTOM_INI) \
$(EOLIST)
CCOPT_DEPENDS = $(STANDARD_DEPENDS)
$(NLM_NAME)_LINKOPT_DEPENDS = \
$(TARGET_lib) \
$(STANDARD_DEPENDS) \
$(VERSION_INC) \
$(EOLIST)
ifeq "$(words $(strip $(TARGET_lib)))" "1"
LIB_NAME = $(basename $(notdir $(TARGET_lib)))
$(LIB_NAME)_LIBLST_DEPENDS = \
$(FILES_lib_objs) \
$(STANDARD_DEPENDS) \
$(CUSTOM_INI) \
$(EOLIST)
endif
ifeq "$(wildcard NWGNU$(LIB_NAME))" "NWGNU$(LIB_NAME)"
$(LIB_NAME)_LIBLST_DEPENDS += NWGNU$(LIB_NAME)
CCOPT_DEPENDS += NWGNU$(LIB_NAME)
else
CCOPT_DEPENDS += NWGNUmakefile
endif
ifeq "$(wildcard NWGNU$(NLM_NAME))" "NWGNU$(NLM_NAME)"
$(NLM_NAME)_LINKOPT_DEPENDS += NWGNU$(NLM_NAME)
CCOPT_DEPENDS += NWGNU$(NLM_NAME)
else
CCOPT_DEPENDS += NWGNUmakefile
endif
CPPOPT_DEPENDS = $(CCOPT_DEPENDS)
#
# Generic compiler rules
#
ifneq "$(MAKECMDGOALS)" "clean"
ifneq "$(findstring clobber_,$(MAKECMDGOALS))" "clobber_"
$(APBUILD)/NWGNUversion.inc: $(APBUILD)/nw_ver.awk $(SRC)/include/ap_release.h
-include $(APBUILD)/NWGNUversion.inc
ifneq "$(strip $(VERSION_STR))" ""
VERSION_INC = $(APBUILD)/NWGNUversion.inc
else
VERSION = 2,5,0
VERSION_STR = 2.5.0
VERSION_MAJMIN = 25
endif
endif
endif
ifeq "$(USE_SVNREV)" "1"
ifneq "$(strip $(SVN_REVISION))" ""
CFLAGS += -DAP_SERVER_ADD_STRING=\"$(SVN_REVISION)\"
endif
endif
ifeq "$(words $(strip $(TARGET_nlm)))" "1"
$(OBJDIR)/%.o: %.c $(OBJDIR)/$(NLM_NAME)_cc.opt
$(OBJDIR)/$(NLM_NAME)_cc.opt: $(CCOPT_DEPENDS)
$(call DEL,$@)
ifneq "$(strip $(CFLAGS))" ""
endif
ifneq "$(strip $(XCFLAGS))" ""
endif
ifneq "$(strip $(XINCDIRS))" ""
endif
ifneq "$(strip $(INCDIRS))" ""
endif
ifneq "$(strip $(DEFINES))" ""
endif
ifneq "$(strip $(XDEFINES))" ""
endif
$(OBJDIR)/%.o: %.cpp $(OBJDIR)/$(NLM_NAME)_cpp.opt
$(OBJDIR)/$(NLM_NAME)_cpp.opt: $(CPPOPT_DEPENDS)
$(call DEL,$@)
ifneq "$(strip $(CFLAGS))" ""
endif
ifneq "$(strip $(XCFLAGS))" ""
endif
ifneq "$(strip $(XINCDIRS))" ""
endif
ifneq "$(strip $(INCDIRS))" ""
endif
ifneq "$(strip $(DEFINES))" ""
endif
ifneq "$(strip $(XDEFINES))" ""
endif
endif # one target nlm
#
# Rules to build libraries
#
# If we only have one target library then build it
ifeq "$(words $(strip $(TARGET_lib)))" "1"
$(TARGET_lib) : $(OBJDIR)/$(LIB_NAME)_lib.lst
$(call DEL,$@)
$(LIB) -o $@ @$<
$(OBJDIR)/$(LIB_NAME)_lib.lst: $($(LIB_NAME)_LIBLST_DEPENDS)
$(call DEL,$@)
ifneq "$(strip $(FILES_lib_objs))" ""
endif
else # We must have more than one target library so load the individual makefiles
$(OBJDIR)/%.lib: NWGNU% $(STANDARD_DEPENDS) FORCE
endif
#
# Rules to build nlms.
#
# If we only have one target NLM then build it
ifeq "$(words $(strip $(TARGET_nlm)))" "1"
$(TARGET_nlm) : $(FILES_nlm_objs) $(FILES_nlm_libs) $(OBJDIR)/$(NLM_NAME)_link.opt
# This will force the link option file to be rebuilt if we change the
# corresponding makefile
$(OBJDIR)/$(NLM_NAME)_link.opt : $($(NLM_NAME)_LINKOPT_DEPENDS)
$(call DEL,$@)
ifneq "$(FILE_nlm_copyright)" ""
@$(CAT) $(FILE_nlm_copyright)>> $@
endif
ifeq "$(RELEASE)" "debug"
else
endif
ifneq "$(IPV6)" ""
endif
ifneq "$(LDAPSDK)" ""
endif
ifneq "$(strip $(XLFLAGS))" ""
endif
ifneq "$(strip $(FILES_nlm_objs))" ""
endif
ifneq "$(FILES_nlm_libs)" ""
endif
ifneq "$(FILE_nlm_msg)" ""
endif
ifneq "$(FILE_nlm_hlp)" ""
endif
ifeq "$(FILE_nlm_copyright)" ""
endif
# @echo $(DL)version $(NLM_VERSION) $(DL)>> $(@:.opt=.def)
ifneq "$(NLM_CHECK_SYM)" ""
endif
ifneq "$(FILES_nlm_modules)" ""
@echo $(DL)module $(foreach module,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_modules))),$(module))$(DL)>> $(@:.opt=.def)
endif
ifneq "$(FILES_nlm_Ximports)" ""
@echo $(DL)import $(foreach import,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_Ximports))),$(import))$(DL)>> $(@:.opt=.def)
endif
ifneq "$(FILES_nlm_exports)" ""
@echo $(DL)export $(foreach export,$(subst $(SPACE),$(COMMA),$(strip $(FILES_nlm_exports))),$(export))$(DL)>> $(@:.opt=.def)
endif
# if APACHE_UNIPROC is defined, don't include XDCData
ifndef APACHE_UNIPROC
ifneq "$(string $(XDCDATA))" ""
else
endif
endif
else # more than one target so look for individual makefiles.
# Only include these if NO_LICENSE_FILE isn't set to prevent excessive
# recursion
ifndef NO_LICENSE_FILE
$(OBJDIR)/%.nlm: NWGNU% $($(NLM_NAME)_LINKOPT_DEPENDS) FORCE
@$(ECHONL)
else
$(TARGET_nlm):
endif # NO_LICENSE_FILE
endif