Makefile
e60a9728
 # $Id$
 #
 # sip_router makefile
 #
1b1b19d8
 # WARNING: requires gmake (GNU Make)
c1aeab16
 #  Arch supported: Linux, FreeBSD, SunOS (tested on Solaris 6), WinNT (cygwin)
e60a9728
 
96001c50
 auto_gen=lex.yy.c cfg.tab.c   #lexx, yacc etc
247c2b65
 
 #include  source related defs
 include Makefile.sources
 
33032483
 exclude_modules=CVS mysql 
74ad0b8e
 #mysql auth rr
b748ffc7
 static_modules=
404073d3
 static_modules_path=$(addprefix modules/, $(static_modules))
 extra_sources=$(wildcard $(addsuffix /*.c, $(static_modules_path)))
 extra_objs=$(extra_sources:.c=.o)
 
 static_defs= $(foreach  mod, $(static_modules), \
af9d50fc
 		-DSTATIC_$(shell echo $(mod) | tr [:lower:] [:upper:]) )
404073d3
 DEFS+=$(static_defs)
 modules=$(filter-out $(addprefix modules/, \
 			$(exclude_modules) $(static_modules)), \
 			$(wildcard modules/*))
e60a9728
 
f20a56a2
 NAME=ser
e60a9728
 
247c2b65
 ALLDEP=Makefile Makefile.sources Makefile.defs Makefile.rules
f8734075
 
247c2b65
 #include general defs (like CC, CFLAGS  a.s.o)
 include Makefile.defs
0ae4dfdc
 
247c2b65
 #export relevant variables to the sub-makes
 export DEFS PROFILE CC  LD MKDEP MKTAGS CFLAGS LDFLAGS MOD_CFLAGS MOD_LDFLAGS
 export LEX YACC YACC_FLAGS
0ae4dfdc
 
04bb7a49
 
247c2b65
 # include the common rules
 include Makefile.rules
e60a9728
 
247c2b65
 #extra targets 
3e429f5c
 
04bb7a49
 $(NAME): static_modules
 
a15c363f
 lex.yy.c: cfg.lex $(ALLDEP)
 	$(LEX) $<
 
f8734075
 cfg.tab.c: cfg.y $(ALLDEP)
a15c363f
 	$(YACC) $(YACC_FLAGS) $<
 
e60a9728
 .PHONY: all
96001c50
 all: $(NAME) modules
e60a9728
 
404073d3
 
96001c50
 
 .PHONY: modules
 modules:
e7a9bd30
 	-@for r in $(modules) "" ; do \
 		if [ -n "$$r" ]; then \
 			echo  "" ; \
 			echo  "" ; \
 			$(MAKE) -C $$r ; \
 		fi ; \
 	done 
404073d3
 
 .PHONY: static_modules
 static_modules:
e7a9bd30
 	-@echo "Extra objs: $(extra_objs)" 
 	-@for r in $(static_modules_path) "" ; do \
 		if [ -n "$$r" ]; then \
 			echo  "" ; \
 			echo  "Making static module $r" ; \
 			$(MAKE) -C $$r static ; \
 		fi ; \
 	done 
404073d3
 
 
247c2b65
 	
f571aa35
 dbg: ser
 	gdb -command debug.gdb
247c2b65
 
 
 tar: mantainer-clean 
 	tar -C .. -zcf ../$(NAME)-$(RELEASE)_src.tar.gz  $(notdir $(CURDIR)) 
04bb7a49