Skip to content

Commit

Permalink
Merge commit 'origin/ser_core_cvs'
Browse files Browse the repository at this point in the history
* commit 'origin/ser_core_cvs':
  tcp: added missing blacklist on write pollerr
  makefiles: minor fix (use COREPATH in Makefile.targets)
  makefile: config and modules.lst minor fixes
  makefile.doc: support all targets and dep. fixes
  doc (INSTALL): minor make update
  makefiles: fixes and speed-ups
  makefiles: typo fixed

Conflicts:
	Makefile.doc
	Makefile.rules
	Makefile.targets
  • Loading branch information
poandrei committed Apr 23, 2009
2 parents 0705191 + fb751cb commit 69f3a24
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 54 deletions.
20 changes: 18 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,29 @@ Example: make modules-list include_modules="tls" skip_modules="print"
Clean:

make clean (clean the modules too)
make proper (clean also the dependencies and the config)
make proper (clean also the dependencies and the config, but not the module
list)
make distclean (the same as proper)
make mantainer-clean (clean everything, including make's config, saved
make maintainer-clean (clean everything, including make's config, saved
module list, auto generated files, tags, *.dbg a.s.o)
make clean-all (clean all the modules in modules/*)
make proper-all (like make proper but for all the modules in modules/*)

Config clean:

make clean-cfg (cleans the compile config)
make clean-modules-cfg (cleans the modules list)

"Reduced" clean:

make local-clean (cleans only the core, no libs, utils or modules)
make clean-modules (like make clean, but cleans only the modules)
make clean-libs (like make clean, but cleans only the libs)
make clean-utils (like make clean, but cleans only the utils
make proper-modules (like make proper, but only for modules)
make proper-libs (like make proper, but only for libs)
make proper-utils (like make proper, but only for utils)

Compile:

make proper
Expand Down
55 changes: 43 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
# 2009-04-02 workaround for export not supported in gnu make 3.80
# target specific variables: use mk_params for each
# $(MAKE) invocation (andrei)
# 2009-04-22 don't rebuild config.mak or modules.lst if not needed
# (e.g. on clean) (andrei)
#

# check make version
Expand All @@ -77,6 +79,8 @@ auto_gen_others=cfg.tab.h # auto generated, non-c

#include source related defs
include Makefile.sources
#include special targets lists
include Makefile.targets

# whether or not the entire build process should fail if building a module or
# an utility fails
Expand All @@ -97,7 +101,15 @@ include Makefile.dirs
# Alternatives are txt, html, xhtml, and pdf (see Makefile.doc)
doc_format?=html

# don't force modules.lst generation if the makefile goals do not
# require it (but if present use it)
ifeq (,$(strip $(filter-out $(clean_targets) $(aux_targets),$(MAKECMDGOALS))))
ifneq (,$(strip $(wildcard modules.lst)))
-include modules.lst
endif
else
include modules.lst
endif # ifneq (,$(strip $(filter-out ...,$(MAKECMDGOALS))))

#if called with group_include, ignore the modules from modules.lst
ifneq ($(group_include),)
Expand Down Expand Up @@ -230,15 +242,17 @@ ALLDEP=config.mak Makefile Makefile.dirs Makefile.sources Makefile.rules
#C_DEFS:=


# try saved cfg, unless we are in the process of building it
ifeq (,$(filter config.mak config cfg cfg-defs,$(MAKECMDGOALS)))
# try saved cfg, unless we are in the process of building it or if we're doing
# a clean
ifeq (,$(strip \
$(filter config.mak config cfg cfg-defs $(clean_targets),$(MAKECMDGOALS))))
include config.mak
ifeq ($(makefile_defs),1)
$(info config.mak loaded)
# config_make valid & used
config_mak=1
endif
else
else # config.mak doesn't need to be used
ifneq (,$(filter cfg config cfg-defs,$(word 1,$(MAKECMDGOALS))))
# needed here to avoid starting a config submake
# (e.g. rm -f config.mak; make config.mak), which would either require
Expand Down Expand Up @@ -351,7 +365,6 @@ ifneq ($(TLS),)
endif

# include the common rules
include Makefile.targets
include Makefile.rules

#extra targets
Expand Down Expand Up @@ -411,13 +424,14 @@ modules.lst:
$(call cfg_save_var2,$(mods),$@))
@echo "modules_configured:=1" >>$@


.PHONY: cfg config cfg-defs
cfg-defs: config.mak

cfg config: cfg-defs modules-cfg

.PHONY: modules-cfg modules-list modules-lst
modules-cfg modules-list modules-lst:
modules-cfg modules-list modules-lst:
rm -f modules.lst
$(MAKE) modules.lst

Expand Down Expand Up @@ -851,23 +865,40 @@ install-man: install-ser-man install-every-module-man



.PHONY: clean_libs
# libs cleaning targets
.PHONY: clean-libs
clean-libs:
$(MAKE) -C lib clean

clean_libs:
$(MAKE) -C lib proper
.PHONY: proper-libs realclean-libs distclean-libs maintainer-clean-libs
proper-libs realclean-libs distclean-libs maintainer-clean-libs:
$(MAKE) -C lib $(patsubst %-libs,%,$@)


# clean modules on make clean
clean: clean-modules
# clean utils on make clean
clean: clean-utils
# cleaning in libs always when cleaning ser
clean: clean_libs
clean: clean-libs

# proper/distclean a.s.o modules, utils and libs too

proper: proper-modules proper-utils proper-libs
distclean: distclean-modules distclean-utils distclean-libs
realclean: realclean-modules realclean-utils realclean-libs
maintainer-clean: maintainer-clean-modules maintainer-clean-utils \
maintainer-clean-libs

#try to clean everything (including all the modules, even ones that are not
# configured/compiled normally
.PHONY: clean-all
clean-all: cmodules=$(all_modules_lst)
clean-all: clean
maintainer-clean: modules=$(modules_all)

# on make proper clean also the build config (w/o module list)
proper realclean distclean: clean_cfg
proper realclean distclean maintainer-clean: clean_cfg

# on maintainer clean, remove also the configured module list
maintainer-clean: clean_modules_cfg
Expand All @@ -877,8 +908,8 @@ proper-all realclean-all distclean-all: cmodules=$(all_modules_lst)
proper-all realclean-all distclean-all: proper


.PHONY: clean_cfg
clean_cfg:
.PHONY: clean_cfg clean-cfg
clean_cfg clean-cfg:
rm -f config.mak

.PHONY: clean_modules_cfg clean-modules-cfg
Expand Down
18 changes: 14 additions & 4 deletions Makefile.doc
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,25 @@ clean:
@rm -f $(pdf_files)
@rm -f $(html_files)

.PHONY: proper realclean distclean
proper realclean distclean: clean
.PHONY: proper distclean realclean maintainer-clean
proper realclean distclean maintainer-clean: clean
@rm -f $(dep_files) *~

maintainer-clean: clean-tmp

.PHONY: clean-tmp
clean-tmp:
-rm -f TAGS tags *.dbg .*.swp



ifeq (,$(MAKECMDGOALS))
include $(dep_files)
else
ifeq (,$(strip $(nodep_targets)))
include $(ROOT_DIR)/Makefile.targets
endif
ifneq (,$(filter-out clean proper realclean distclean check, $(MAKECMDGOALS)))
ifneq (,$(filter-out $(nodep_targets) check, $(MAKECMDGOALS)))
include $(dep_files)
endif

endif
9 changes: 3 additions & 6 deletions Makefile.libs
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,13 @@ link_clean:
-@rm -f $(LIB_RUNTIME_NAME)
-@rm -f $(LIB_LINK_NAME)

clean: link_clean
local-clean: link_clean

ifneq ($(strip $(LIBINAME_F)),)
.PHONY: libiname_clean

libiname_clean:
-@rm -f "$(LIBINAME_F)"
-@rm -f libiname.lst

clean: libiname_clean
endif
local-clean: libiname_clean

$(lib_prefix)/$(lib_dir):
mkdir -p $(lib_prefix)/$(lib_dir)
Expand Down
68 changes: 46 additions & 22 deletions Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -170,54 +170,78 @@ dep: $(depends)
.PHONY: static
static: $(objs)

.PHONY: clean
clean:
# clean only the current directory (no modules or utils)
# (it's usefull to have it separated from clean for speeding up make proper)
.PHONY: local-clean
local-clean:
-@rm -f $(objs) $(NAME) $(objs:.o=.il) librpath.lst 2>/dev/null

.PHONY: clean
clean: local-clean

.PHONY: clean-modules
clean-modules:
-@for r in $(cmodules) $(static_modules_path) "" ; do \
if [ -d "$$r" ]; then \
echo "module $$r" ; \
$(MAKE) -C $$r clean ; \
$(MAKE) -C $$r/doc clean ; \
$(MAKE) -C "$$r" clean ; \
[ -d "$$r"/doc/Makefile ] && $(MAKE) -C "$$r"/doc clean ; \
fi ; \
done
done

.PHONY: clean-utils
clean-utils:
@if [ -n "$(cmodules)" ]; then \
for r in $(utils_compile) "" ; do \
if [ -d "$$r" ]; then \
$(MAKE) -C $$r clean ; \
$(MAKE) -C "$$r" clean ; \
fi ; \
done \
fi

# make proper for the local directory
.PHONY: proper
.PHONY: distclean
.PHONY: realclean
proper realclean distclean: mrproper

mrproper: clean
.PHONY: maintainer-clean
proper distclean realclean maintainer-clean: local-clean
-@rm -f $(depends) $(auto_gen) $(auto_gen_others) \
makecfg.lst 2>/dev/null

maintainer-clean: clean-tmp

.PHONY: proper-modules
.PHONY: distclean-modules
.PHONY: realclean-modules
.PHONY: maintainer-clean-modules
proper-modules realclean-modules distclean-modules maintainer-clean-modules: \
clean_target=$(patsubst %-modules,%,$@)
proper-modules realclean-modules distclean-modules maintainer-clean-modules:
-@for r in $(cmodules) "" ; do \
if [ -d "$$r" ]; then \
$(MAKE) -C $$r proper ; \
$(MAKE) -C $$r/doc proper ; \
$(MAKE) -C "$$r" $(clean_target); \
[ -r "$$r"/doc/Makefile ] && $(MAKE) -C "$$r"/doc $(clean_target);\
fi ; \
done
done

.PHONY: proper-utils
.PHONY: distclean-utils
.PHONY: realclean-utils
.PHONY: maintainer-clean-utils
proper-utils realclean-utils distclean-utils maintainer-clean-utils: \
clean_target=$(patsubst %-utils,%,$@)
proper-utils realclean-utils distclean-utils maintainer-clean-utils:
@if [ -n "$(cmodules)" ]; then \
for r in $(utils_compile) "" ; do \
if [ -d "$$r" ]; then \
$(MAKE) -C $$r proper ; \
$(MAKE) -C "$$r" $(clean_target); \
fi ; \
done \
fi

.PHONY: mantainer-cleaan
mantainer-clean: distclean
-rm -f TAGS tags *.dbg .*.swp
-@for r in $(cmodules) "" ; do \
if [ -d "$$r" ]; then \
$(MAKE) -C $$r mantainer-clean; \
fi ; \
done
.PHONY: clean-tmp
clean-tmp:
-@rm -f TAGS tags *.dbg .*.swp


.PHONY: doxygen
Expand All @@ -242,7 +266,7 @@ ifeq (,$(MAKECMDGOALS))
-include $(depends)
else
ifeq (,$(strip $(nodep_targets)))
include Makefile.targets
include $(COREPATH)/Makefile.targets
endif
ifneq (,$(filter-out $(nodep_targets),$(MAKECMDGOALS)))
-include $(depends)
Expand Down
15 changes: 11 additions & 4 deletions Makefile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,25 @@ ifeq (,$(strip $(modules_dirs)))
include $(COREPATH)/Makefile.dirs
endif

clean_targets:= clean proper distclean realclean mantainer-clean clean_libs \
clean_targets:= clean proper distclean realclean maintainer-clean local-clean \
clean-all proper-all distclean-all realclean-all \
clean_cfg clean_modules_cfg clean-modules-cfg
clean_cfg clean-cfg clean_modules_cfg clean-modules-cfg \
clean-modules proper-modules realclean-modules \
distclean-modules maintainer-clean-modules \
clean-utils proper-utils realclean-utils distclean-utils \
maintaner-clean-utils \
clean-libs proper-libs realclean-libs distclean-libs \
maintainer-clean-libs \
clean-tmp clean_doxygen
doc_targets:= README man install-doc install-man install-ser-man \
install-every-module-doc install-every-module-man \
$(foreach m,$(modules_dirs),$(m)-doc $(m)-readme $(m)-man) \
$(foreach m,$(modules_dirs),install-$(m)-doc install-$(m)-man)

# auxiliary: maintance, debugging, etc. (don't affect code/objects)
aux_targets:= TAGS tar dist cfg-defs cfg config config.mak print-modules \
dbg dbinstall librpath.lst makecfg.lst \
modules-cfg modules-list modules-lst modules.lst mk-install_dirs
dbg dbinstall librpath.lst makecfg.lst modules.lst modules-cfg \
modules-list modules-lst mk-install_dirs
# other targets that don't produce code in the current directory ("external")
ext_targets:= every-module $(modules_dirs) libs utils \
install-cfg install-utils install-modules-all install-every-module\
Expand Down
11 changes: 7 additions & 4 deletions lib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
#


SUBDIRS=binrpc cds xcap presence shm_regex
#SUBDIRS=binrpc cds xcap presence shm_regex

SUBDIRS=$(filter-out CVS doc $(lib_exclude), $(strip \
$(patsubst %/Makefile,%,$(wildcard */Makefile))))

.PHONY: subdirs $(SUBDIRS)

Expand All @@ -22,11 +25,11 @@ subdirs: $(SUBDIRS)
$(SUBDIRS):
-@echo "Making $(sub_goals) in $@" ; $(MAKE) $(sub_goals) -C $@

all: subdirs
include ../Makefile.targets

proper: clean
all: subdirs

clean: subdirs
$(clean_targets): subdirs

install: subdirs

Loading

0 comments on commit 69f3a24

Please sign in to comment.