Преглед на файлове

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 преди 16 години
родител
ревизия
1849815b51
променени са 2 файла, в които са добавени 12 реда и са изтрити 8 реда
  1. 8 4
      Makefile
  2. 4 4
      Makefile.rules

+ 8 - 4
Makefile

@@ -79,7 +79,8 @@ endif
 
 
 auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
-auto_gen_others=cfg.tab.h autover.h  # auto generated, non-c
+auto_gen_others=cfg.tab.h # auto generated, non-c
+auto_gen_keep=autover.h # auto generated, should be included in archives
 
 COREPATH=.
 #include  source related defs
@@ -397,11 +398,12 @@ modules_search_path=$(subst $(space),:,$(strip\
 		#				$(addprefix $(modules_target),$(modules_dirs))))
 
 # special depends for main.o
-main.o: autover.h
+main.d main.o: autover.h
 main.o: DEFS+=-DMODS_DIR='"$(modules_search_path)"'
 
+
 #special depends for core_cmd.o
-core_cmd.o: autover.h
+core_cmd.d core_cmd.o: autover.h
 
 include Makefile.shared
 
@@ -657,13 +659,14 @@ dbg: sip-router
 
 dist: tar
 
-tar: autover.h
+tar: $(auto_gen_keep)
 	$(TAR) -C .. \
 		--exclude=$(notdir $(CURDIR))/test* \
 		--exclude=$(notdir $(CURDIR))/tmp* \
 		--exclude=$(notdir $(CURDIR))/debian/$(MAIN_NAME) \
 		--exclude=$(notdir $(CURDIR))/debian/$(MAIN_NAME)-* \
 		--exclude=$(notdir $(CURDIR))/$(MAIN_NAME)_tls* \
+		--exclude=.git* \
 		--exclude=CVS* \
 		--exclude=.svn* \
 		--exclude=.cvsignore \
@@ -682,6 +685,7 @@ tar: autover.h
 		--exclude=*.patch \
 		--exclude=.\#* \
 		--exclude=*.swp \
+		--exclude=*.swo \
 		${tar_extra_args} \
 		-cf - $(notdir $(CURDIR)) | \
 			(mkdir -p tmp/_tar1; mkdir -p tmp/_tar2 ; \

+ 4 - 4
Makefile.rules

@@ -7,9 +7,9 @@
 
 #
 # Uses: NAME, ALLDEP, CC, CFLAGS, C_DEFS, DEFS, C_INCLUDES, INCLUDES, LIBS, 
-#       MKDEP, auto_gen, 
-# auto_gen_others, depends, objs, extra_objs, static_modules, 
-# static_modules_path, LD_RPATH
+#       MKDEP, auto_gen, auto_gen_others, auto_gen_keep, 
+#       depends, objs, extra_objs, static_modules, static_modules_path,
+#       LD_RPATH
 # (all this must  be defined previously!,  see Makefile.defs & Makefile)
 # Optional: SER_LIBS - list of ser libraries that will be automatically
 #  built if necessary. Format: path/shortname, where shortname is the 
@@ -205,7 +205,7 @@ clean-utils:
 .PHONY: realclean
 .PHONY: maintainer-clean
 proper distclean realclean maintainer-clean: local-clean
-	-@rm -f $(depends) $(auto_gen) $(auto_gen_others) \
+	-@rm -f $(depends) $(auto_gen) $(auto_gen_others) $(auto_gen_keep) \
 			makecfg.lst 2>/dev/null
 
 maintainer-clean: clean-tmp