Browse Source

backported from stable:
- make proper deletes also cfg.tab.h
- make tar excludes the auto generated files

Andrei Pelinescu-Onciul 20 years ago
parent
commit
9de818a221
2 changed files with 7 additions and 4 deletions
  1. 4 1
      Makefile
  2. 3 3
      Makefile.rules

+ 4 - 1
Makefile

@@ -31,7 +31,8 @@
 #               referred in the man pages
 #
 
-auto_gen=lex.yy.c cfg.tab.c   #lexx, yacc etc
+auto_gen=lex.yy.c cfg.tab.c #lexx, yacc etc
+auto_gen_others=cfg.tab.h  # auto generated, non-c
 
 #include  source related defs
 include Makefile.sources
@@ -113,6 +114,8 @@ export PREFIX LOCALBASE
 #export INSTALL INSTALL-CFG INSTALL-BIN INSTALL-MODULES INSTALL-DOC INSTALL-MAN 
 #export INSTALL-TOUCH
 
+tar_extra_args+=$(addprefix --exclude=$(notdir $(CURDIR))/, \
+					$(auto_gen) $(auto_gen_others))
 ifneq ($(TLS),)
 	tar_extra_args+=
 else

+ 3 - 3
Makefile.rules

@@ -6,8 +6,8 @@
 #
 
 #
-# Uses: NAME, ALLDEP, CC, CFLAGS, DEFS, LIBS, MKDEP, auto_gen, depends, objs,
-# extra_objs, static_modules, static_modules_path
+# Uses: NAME, ALLDEP, CC, CFLAGS, DEFS, LIBS, MKDEP, auto_gen, auto_gen_others,
+# depends, objs, extra_objs, static_modules, static_modules_path
 # (all this must  be defined previously!,  see Makefile.defs & Makefile)
 #
 
@@ -55,7 +55,7 @@ clean:
 .PHONY: distclean
 .PHONY: realclean
 proper realclean distclean: clean 
-	-@rm -f $(depends) $(auto_gen) 2>/dev/null
+	-@rm -f $(depends) $(auto_gen) $(auto_gen_others) 2>/dev/null
 	-@for r in $(modules) "" ; do \
 		if [ -d "$$r" ]; then \
 			 $(MAKE) -C $$r proper ; \