37428e2001-10-05Fredrik Hübinette (Hubbe) LC_REQ=@LC_REQ@
e12ea71997-06-04Henrik Grubbström (Grubba) 
7d095c2003-05-15Henrik Grubbström (Grubba) LINKAGE_CPPFLAGS=
a0ad632006-06-18Martin Stjernholm DYNAMIC_LINKAGE_CFLAGS=@CCSHARED@
a73a4f2016-12-11Henrik Grubbström (Grubba) DYNAMIC_LINKAGE_CXXFLAGS=@CCSHARED@
a0ad632006-06-18Martin Stjernholm STATIC_LINKAGE_CFLAGS= LINKAGE_CFLAGS=$(DYNAMIC_LINKAGE_CFLAGS)
a73a4f2016-12-11Henrik Grubbström (Grubba) LINKAGE_CXXFLAGS=$(DYNAMIC_LINKAGE_CXXFLAGS)
319a881997-02-06Fredrik Hübinette (Hubbe) 
fd0fd72004-04-17Marcus Comstedt MODULE_PROGRAM=.$(MODULE_WRAPPER_PREFIX)$(MODNAME) MODULE_TARGET=$(TMP_MODULE_BASE)/$(MODDIR)$(MODULE_WRAPPER_PREFIX)$(MODNAME).so
319a881997-02-06Fredrik Hübinette (Hubbe) 
a0ad632006-06-18Martin Stjernholm # The reason for this is that we can't use targets directly to specify # the build type; many module makefiles depend on being able to # override the default target. all: @case "x$$MODULE_BUILD_TYPE" in \ xstatic) $(MAKE) $(MAKE_FLAGS) static;; \ xdynamic) $(MAKE) $(MAKE_FLAGS) dynamic;; \ x) $(MAKE) $(MAKE_FLAGS) static dynamic;; \ *) \ echo "Invalid MODULE_BUILD_TYPE: $$MODULE_BUILD_TYPE" >&2; \ exit 1;; \ esac
d010c12002-08-14Henrik Grubbström (Grubba) 
5a39882003-05-07Henrik Grubbström (Grubba) @common_module_makefile@
d010c12002-08-14Henrik Grubbström (Grubba) 
c68b042014-01-11Henrik Grubbström (Grubba) build_type: Makefile
a0ad632006-06-18Martin Stjernholm  @echo dynamic > build_type
9479712006-08-02Martin Stjernholm static: Makefile $(DUMMY) module-preamble
a0ad632006-06-18Martin Stjernholm  @:
9479712006-08-02Martin Stjernholm # Depend on $(DUMMY) here too for the sake of post modules, where the # static target never gets called. dynamic: $(DUMMY) module-main
a0ad632006-06-18Martin Stjernholm  @:
a582151997-03-12Henrik Grubbström (Grubba) linker_options: Makefile
5a39882003-05-07Henrik Grubbström (Grubba)  @if test "x$(LINKER_OPTIONS)" != x ; then \
a0ad632006-06-18Martin Stjernholm  echo "echo $(LINKER_OPTIONS) > linker_options" ; \
5a39882003-05-07Henrik Grubbström (Grubba)  else : ; fi ; \ echo "$(LINKER_OPTIONS)" >linker_options
a582151997-03-12Henrik Grubbström (Grubba)  modlist_segment: Makefile
44549e1999-10-04Fredrik Hübinette (Hubbe)  @echo "" >modlist_segment
319a881997-02-06Fredrik Hübinette (Hubbe) 
5a39882003-05-07Henrik Grubbström (Grubba) # Can't depend on $(SRCDIR)/$(CONFIG_HEADERS).in since
b8d2222002-04-30Martin Stjernholm # $(CONFIG_HEADERS) isn't always used. Makefile: $(MODULE_BASE)/dynamic_module_makefile $(SRCDIR)/Makefile.in $(SRCDIR)/dependencies make_variables config.status
1df12f2002-01-27Martin Stjernholm  CONFIG_FILES=Makefile CONFIG_HEADERS="$(CONFIG_HEADERS)" ./config.status
09df841998-02-10Fredrik Hübinette (Hubbe)  touch remake
c3b6451999-10-05Henrik Grubbström (Grubba)  @echo "Run make again" >&2
9f1f1c1997-05-08Henrik Grubbström (Grubba)  @exit 1
5a39882003-05-07Henrik Grubbström (Grubba) $(MODULE_TARGET): module.so
25083e2003-10-29H. William Welliver III  @if test "x$(OBJS)" = "x" ; then \
334eeb2003-10-28H. William Welliver III  exit 0; \ fi; \
d8b39f2003-12-21H. William Welliver III  if test "x$(PIKE_EXTERNAL_MODULE)" = "x" ; then \
316a212006-08-02Martin Stjernholm  $(TMP_BINDIR)/install_module module.so $(MODULE_TARGET) && \ if [ -f $(MODNAME).pdb ]; then \ cp $(MODNAME).pdb `echo "$(MODULE_TARGET)" | sed -e 's,[^/]*$$,,'`; \ else :; fi; \
d8b39f2003-12-21H. William Welliver III  fi
fa08022000-03-10Fredrik Hübinette (Hubbe) 
4eac6b2006-06-28Martin Stjernholm module.so: $(MODULE_ARCHIVES) $(OBJS) $(LDSHARED_MODULE_REQS)
334eeb2003-10-28H. William Welliver III  @if test "x$(OBJS)" = "x" ; then \
c2b0632003-10-30H. William Welliver III  exit 0; \
334eeb2003-10-28H. William Welliver III  fi; \ echo "Linking $(MODNAME)" ;\
316a212006-08-02Martin Stjernholm  modname="$(MODNAME)"; \
4eac6b2006-06-28Martin Stjernholm  if $(TMP_BINDIR)/smartlink $(MOD_LDSHARED) $(LDFLAGS) -o module.@SO@ \
334eeb2003-10-28H. William Welliver III  $(OBJS) $(MODULE_ARCHIVES) $(MODULE_LDFLAGS) \ $(LIBGCC) $(LC_REQ) $(LIBGCC) ; then \
c3b6451999-10-05Henrik Grubbström (Grubba)  if test @SO@ != so ; then mv module.@SO@ module.so ; else :; fi ;\
44549e1999-10-04Fredrik Hübinette (Hubbe)  else \
c3b6451999-10-05Henrik Grubbström (Grubba)  echo "Linking failed:" >&2; \
4eac6b2006-06-28Martin Stjernholm  echo $(TMP_BINDIR)/smartlink $(MOD_LDSHARED) $(LDFLAGS) -o module.@SO@ $(OBJS) $(MODULE_ARCHIVES) $(MODULE_LDFLAGS) $(LIBGCC) $(LC_REQ) $(LIBGCC) >&2 ;\
1c159a2000-04-11Henrik Grubbström (Grubba)  exit 1; \
44549e1999-10-04Fredrik Hübinette (Hubbe)  fi
d175152006-08-02Martin Stjernholm  $(MT_FIX_MODULE_SO)
1d03d92003-10-30Henrik Grubbström (Grubba) 
8181fb2006-07-05Martin Stjernholm $(OBJS): propagated_variables
6bd0871999-05-29Henrik Grubbström (Grubba) 
c2b0632003-10-30H. William Welliver III # # install a standard module with optional c component in the system module path #
1763ba1997-05-15Henrik Grubbström (Grubba) install: $(MODULE_INSTALL)
c2b0632003-10-30H. William Welliver III  @if test "x$(OBJS)" != "x" ; then \
316a212006-08-02Martin Stjernholm  $(TMP_BINDIR)/install_module module.so $(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODULE_WRAPPER_PREFIX)$(MODNAME).so && \ if [ -f $(MODNAME).pdb ]; then \ cp $(MODNAME).pdb $(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODULE_WRAPPER_PREFIX); \ else :; fi; \
334eeb2003-10-28H. William Welliver III  fi; \
fd0fd72004-04-17Marcus Comstedt  if test "x$(MODULE_PMOD_IN)" != "x"; then \ $(TMP_BINDIR)/install_module module.pmod $(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODNAME).pmod ;\ fi;
c2b0632003-10-30H. William Welliver III  # # install the module in LOCAL_MODULE_PATH, creating it if it doesn't already exist. # local_install: $(MODULE_INSTALL)
d917902003-10-30H. William Welliver III  if test ! -d "$(LOCAL_MODULE_PATH)" ; then \
c2b0632003-10-30H. William Welliver III  mkdir -p $(LOCAL_MODULE_PATH) ; \
d917902003-10-30H. William Welliver III  fi; if test "x$(OBJS)" != "x" ; then \
316a212006-08-02Martin Stjernholm  $(TMP_BINDIR)/install_module module.so $(LOCAL_MODULE_PATH)/$(MODDIR)$(MODULE_WRAPPER_PREFIX)$(MODNAME).so && \ if [ -f $(MODNAME).pdb ]; then \ cp $(MODNAME).pdb $(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODULE_WRAPPER_PREFIX); \ else :; fi; \
c2b0632003-10-30H. William Welliver III  fi; \
fd0fd72004-04-17Marcus Comstedt  if test "x$(MODULE_PMOD_IN)" != "x"; then \ $(TMP_BINDIR)/install_module module.pmod $(LOCAL_MODULE_PATH)/$(MODDIR)$(MODNAME).pmod ;\ fi
c2b0632003-10-30H. William Welliver III 
e414af2003-10-30H. William Welliver III dump_module: install -rm -f dumpmodule.log args=$${args:-"--log-file --update-only=dumpversion --report-failed"}; \
385f542006-08-02Martin Stjernholm  $(FINAL_PIKE) -x dump $$args \
e414af2003-10-30H. William Welliver III  --recursive "$(SYSTEM_MODULE_PATH)/$(MODDIR)$(MODNAME).pmod" dump_local_module: install -rm -f dumpmodule.log args=$${args:-"--log-file --update-only=dumpversion --report-failed"}; \
385f542006-08-02Martin Stjernholm  $(FINAL_PIKE) -x dump $$args \
e414af2003-10-30H. William Welliver III  --recursive "$(LOCAL_MODULE_PATH)/$(MODDIR)$(MODNAME).pmod"