Browse code

makefile: minor fixes

- main.d and core_cmd.d generation failed on clean sources,
because of missing autover.h
- make tar excludes now .git*, *.swo and includes autover.h

Andrei Pelinescu-Onciul authored on 25/06/2009 10:21:35
Showing 2 changed files
... ...
@@ -79,7 +79,8 @@ endif
79 79
 
80 80
 
81 81
 auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
82
-auto_gen_others=cfg.tab.h autover.h  # auto generated, non-c
82
+auto_gen_others=cfg.tab.h # auto generated, non-c
83
+auto_gen_keep=autover.h # auto generated, should be included in archives
83 84
 
84 85
 COREPATH=.
85 86
 #include  source related defs
... ...
@@ -397,11 +398,12 @@ modules_search_path=$(subst $(space),:,$(strip\
397 397
 		#				$(addprefix $(modules_target),$(modules_dirs))))
398 398
 
399 399
 # special depends for main.o
400
-main.o: autover.h
400
+main.d main.o: autover.h
401 401
 main.o: DEFS+=-DMODS_DIR='"$(modules_search_path)"'
402 402
 
403
+
403 404
 #special depends for core_cmd.o
404
-core_cmd.o: autover.h
405
+core_cmd.d core_cmd.o: autover.h
405 406
 
406 407
 include Makefile.shared
407 408
 
... ...
@@ -657,13 +659,14 @@ dbg: sip-router
657 657
 
658 658
 dist: tar
659 659
 
660
-tar: autover.h
660
+tar: $(auto_gen_keep)
661 661
 	$(TAR) -C .. \
662 662
 		--exclude=$(notdir $(CURDIR))/test* \
663 663
 		--exclude=$(notdir $(CURDIR))/tmp* \
664 664
 		--exclude=$(notdir $(CURDIR))/debian/$(MAIN_NAME) \
665 665
 		--exclude=$(notdir $(CURDIR))/debian/$(MAIN_NAME)-* \
666 666
 		--exclude=$(notdir $(CURDIR))/$(MAIN_NAME)_tls* \
667
+		--exclude=.git* \
667 668
 		--exclude=CVS* \
668 669
 		--exclude=.svn* \
669 670
 		--exclude=.cvsignore \
... ...
@@ -682,6 +685,7 @@ tar: autover.h
682 682
 		--exclude=*.patch \
683 683
 		--exclude=.\#* \
684 684
 		--exclude=*.swp \
685
+		--exclude=*.swo \
685 686
 		${tar_extra_args} \
686 687
 		-cf - $(notdir $(CURDIR)) | \
687 688
 			(mkdir -p tmp/_tar1; mkdir -p tmp/_tar2 ; \
... ...
@@ -7,9 +7,9 @@
7 7
 
8 8
 #
9 9
 # Uses: NAME, ALLDEP, CC, CFLAGS, C_DEFS, DEFS, C_INCLUDES, INCLUDES, LIBS, 
10
-#       MKDEP, auto_gen, 
11
-# auto_gen_others, depends, objs, extra_objs, static_modules, 
12
-# static_modules_path, LD_RPATH
10
+#       MKDEP, auto_gen, auto_gen_others, auto_gen_keep, 
11
+#       depends, objs, extra_objs, static_modules, static_modules_path,
12
+#       LD_RPATH
13 13
 # (all this must  be defined previously!,  see Makefile.defs & Makefile)
14 14
 # Optional: SER_LIBS - list of ser libraries that will be automatically
15 15
 #  built if necessary. Format: path/shortname, where shortname is the 
... ...
@@ -205,7 +205,7 @@ clean-utils:
205 205
 .PHONY: realclean
206 206
 .PHONY: maintainer-clean
207 207
 proper distclean realclean maintainer-clean: local-clean
208
-	-@rm -f $(depends) $(auto_gen) $(auto_gen_others) \
208
+	-@rm -f $(depends) $(auto_gen) $(auto_gen_others) $(auto_gen_keep) \
209 209
 			makecfg.lst 2>/dev/null
210 210
 
211 211
 maintainer-clean: clean-tmp