From cba970a0ca878e1461fab7992a26b1b34c9af790 Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Wed, 22 Apr 2009 13:18:46 +0200 Subject: [PATCH] make BSD's make work, 2nd try --- BSDmakefile | 12 ++++++++++-- GNUmakefile | 5 +++++ rules.mk | 7 +------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/BSDmakefile b/BSDmakefile index 71f18a1..94573cc 100644 --- a/BSDmakefile +++ b/BSDmakefile @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -.include Makefile +.include "Makefile" CC ?= cc CFLAGS ?= -O2 -Wall @@ -52,4 +52,12 @@ DEFINES += -DDEBUG OBJS = $(SRCS:.c=.o) -.include rules.mk +all: $(program) + +.SUFFIXES: .o .c +.c.o: + $(CC) $(CFLAGS) $(DEFINES) -DVERSION="\"$(version)\"" -c $(.IMPSRC) + +$(OBJS): $(HEADERS) + +.include "rules.mk" diff --git a/GNUmakefile b/GNUmakefile index 3cc4d2a..e679eb7 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -52,4 +52,9 @@ endif OBJS = $(SRCS:.c=.o) +all: $(program) + +%.o: %.c $(HEADERS) + $(CC) $(CFLAGS) $(DEFINES) -DVERSION="\"$(version)\"" -c $< + include rules.mk diff --git a/rules.mk b/rules.mk index 4a57a60..1b0b42d 100644 --- a/rules.mk +++ b/rules.mk @@ -15,12 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -.PHONY: all strip indent clean install uninstall - -all: $(program) - -%.o : %.c $(HEADERS) - $(CC) $(CFLAGS) $(DEFINES) -DVERSION="\"$(version)\"" -c $< +.PHONY: strip indent clean install uninstall $(program): $(OBJS) $(CC) $(CFLAGS) $(OBJS) -o $(program) $(LDFLAGS) $(LIBS)