Makefile.modules
247c2b65
 #
 # $Id$
 #
 # module Makefile
 #(to be included from each module)
 #
3922c022
 # History:
 # --------
 #  2007-03-29  if a module depends on SER_LIBS, it will be rebuilt on install
 #               with the proper rpath; libraries will be automatically
 #               installed if needed (andrei)
 #
 
404073d3
 MOD_NAME=$(NAME:.so=)
247c2b65
 
5f4d291d
 # allow placing modules in separate directory apart from ser core
ad1e3e5c
 COREPATH ?=../..
 
 ALLDEP=Makefile $(COREPATH)/Makefile.sources $(COREPATH)/Makefile.rules \
5f4d291d
  $(COREPATH)/Makefile.modules $(COREPATH)/Makefile.defs
247c2b65
 
3431bcad
 #override modules value, a module cannot have submodules
 override modules=
 override static_modules=
 override static_modules_path=
 
0973fee7
 # should be set in Makefile of apart module
 # INCLUDES += -I$(COREPATH)
3431bcad
 
247c2b65
 ifeq ($(MAKELEVEL), 0)
 # make called directly in the module dir!
 
3922c022
 #$(warning "you should run make from the main ser directory")
4ce32edc
 ifneq ($(makefile_defs), 1)
 $(error "the local makefile does not include Makefile.defs!")
 endif
247c2b65
 
 else
 # called by the main Makefile
 
5f4d291d
 ALLDEP+=$(COREPATH)/Makefile
247c2b65
 
 endif
 
ad1e3e5c
 include $(COREPATH)/Makefile.sources
247c2b65
 
404073d3
 ifeq (,$(filter $(MOD_NAME), $(static_modules)))
247c2b65
 CFLAGS:=$(MOD_CFLAGS)
 LDFLAGS:=$(MOD_LDFLAGS)
404073d3
 endif
247c2b65
 
3922c022
 
ad1e3e5c
 include $(COREPATH)/Makefile.rules
3922c022
 
 
28b28d2c
 $(modules_prefix)/$(modules_dir):
 		mkdir -p $(modules_prefix)/$(modules_dir)
 
3922c022
 
 
 .PHONY: install
28b28d2c
 install: $(NAME) $(modules_prefix)/$(modules_dir)
 	$(INSTALL_TOUCH) $(modules_prefix)/$(modules_dir)/$(NAME)
 	$(INSTALL_MODULES)  $(NAME)  $(modules_prefix)/$(modules_dir)
3922c022
 	@for lib in $(dir $(SER_LIBS)); do \
 		$(MAKE) -C "$${lib}" install-if-newer ;\
 	done