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

- updated Makefile to properly handle mem/*
- fixed makefile bug (make w/ no targets didn't build the dependencies)

Andrei Pelinescu-Onciul преди 24 години
родител
ревизия
04bb7a49c9
променени са 2 файла, в които са добавени 10 реда и са изтрити 4 реда
  1. 5 1
      Makefile
  2. 5 3
      Makefile.rules

+ 5 - 1
Makefile

@@ -34,11 +34,14 @@ include Makefile.defs
 export DEFS PROFILE CC  LD MKDEP MKTAGS CFLAGS LDFLAGS MOD_CFLAGS MOD_LDFLAGS
 export LEX YACC YACC_FLAGS
 
+
 # include the common rules
 include Makefile.rules
 
 #extra targets 
 
+$(NAME): static_modules
+
 lex.yy.c: cfg.lex $(ALLDEP)
 	$(LEX) $<
 
@@ -48,7 +51,6 @@ cfg.tab.c: cfg.y $(ALLDEP)
 .PHONY: all
 all: $(NAME) modules
 
-$(NAME): static_modules
 
 
 .PHONY: modules
@@ -76,3 +78,5 @@ dbg: ser
 
 tar: mantainer-clean 
 	tar -C .. -zcf ../$(NAME)-$(RELEASE)_src.tar.gz  $(notdir $(CURDIR)) 
+
+

+ 5 - 3
Makefile.rules

@@ -13,12 +13,12 @@
 
 
 #implicit rules
-%.o:%.c $(ALLDEP)
+%.o:%.c  $(ALLDEP)
 	$(CC) $(CFLAGS) $(DEFS) -c $< -o $@
 
 %.d: %.c $(ALLDEP)
 	@set -e; $(MKDEP) $< \
-	|  sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
+	|  sed 's#\($*\)\.o[ :]*#\1.o $@ : #g' > $@; \
 	[ -s $@ ] || rm -f $@
 
 
@@ -59,7 +59,9 @@ mantainer-clean: distclean
 TAGS:
 	$(MKTAGS) 
 	
-
+ifeq (,$(MAKECMDGOALS))
+include $(depends)
+endif
 ifneq (,$(filter-out clean proper distclean realclean mantainer-clean TAGS \
 		tar modules, $(MAKECMDGOALS)))
 include $(depends)