5 #(to be included from each module)
9 # 2007-03-29 if a module depends on SER_LIBS, it will be rebuilt on install
10 # with the proper rpath; libraries will be automatically
11 # installed if needed (andrei)
12 # 2008-06-23 added the README & man targets (andrei)
13 # 2008-06-27 make cfg / config.mak support (andrei)
18 # allow placing modules in separate directory apart from ser core
21 ALLDEP=Makefile $(COREPATH)/Makefile.sources $(COREPATH)/Makefile.rules \
22 $(COREPATH)/Makefile.modules $(COREPATH)/config.mak
24 #override modules value, a module cannot have submodules
26 override static_modules=
27 override static_modules_path=
29 # should be set in Makefile of apart module
30 # INCLUDES += -I$(COREPATH)
32 DEFS += -DMOD_NAME='"$(MOD_NAME)"'
34 ifneq ($(makefile_defs_included),1)
35 $(error "the local makefile does not include Makefile.defs!")
38 ifeq ($(MAKELEVEL), 0)
39 # make called directly in the module dir!
41 #$(warning "you should run make from the main ser directory")
44 # called by the main Makefile
46 ALLDEP+=$(COREPATH)/Makefile
50 include $(COREPATH)/Makefile.sources
53 # if config was not loaded (makefile_defs!=1) ignore
54 # the rest of makefile and try only to remake the config
55 ifeq ($(makefile_defs),1)
57 ifeq (,$(filter $(MOD_NAME), $(static_modules)))
59 LDFLAGS:=$(MOD_LDFLAGS)
64 include $(COREPATH)/Makefile.targets
65 include $(COREPATH)/Makefile.rules
69 $(modules_prefix)/$(modules_dir):
70 mkdir -p $(modules_prefix)/$(modules_dir)
72 LIBS:=$(filter-out -ldl -lresolv, $(LIBS))
77 install: $(NAME) $(modules_prefix)/$(modules_dir) install-libs
78 $(INSTALL_TOUCH) $(modules_prefix)/$(modules_dir)/$(NAME)
79 $(INSTALL_MODULES) $(NAME) $(modules_prefix)/$(modules_dir)
82 @for lib in $(dir $(SER_LIBS)); do \
83 $(MAKE) -C "$${lib}" install-if-newer ;\
87 ifneq (,$(wildcard doc/Makefile))
88 #doc/Makefile present => we can generate README
91 $(MAKE) -C doc $(MOD_NAME).txt
92 cp doc/$(MOD_NAME).txt $@
100 #man page build rules
101 ifneq (,$(wildcard $(MOD_NAME).xml))
103 $(MOD_NAME).7: $(MOD_NAME).xml
104 docbook2x-man -s ../../doc/stylesheets/serdoc2man.xsl $<
114 endif # ifeq($(makefile_defs),1)
116 include $(COREPATH)/Makefile.cfg