From f91811f57de0561cc7c8efb5897a6b62f5c0e0b2 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 30 Jan 1999 21:35:36 +0000 Subject: Initial checkin of skeleton application. About to start reading files [originally from svn r22] --- Makefile | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..23eb91e --- /dev/null +++ b/Makefile @@ -0,0 +1,55 @@ +# Buttress master makefile + +# Requires a compiler with -MD support, currently + +# `make' from top level will build in buttress.b +# `make BUILDDIR=foo' from top level will build in directory foo +ifndef REALBUILD +ifndef BUILDDIR +BUILDDIR := build +endif +all: + @test -d $(BUILDDIR) || mkdir $(BUILDDIR) + @make -C $(BUILDDIR) -f ../Makefile REALBUILD=yes +else + +# The `real' makefile part. + +ifdef RELEASE +ifndef VERSION +VERSION := $(RELEASE) +endif +else +CFLAGS += -g +endif + +ifndef VER +ifdef VERSION +VER := $(VERSION) +endif +endif +ifdef VER +VDEF := -DVERSION=\"$(VER)\" +endif + +SRC := ../ + +MODULES := main malloc error help licence version + +OBJECTS := $(addsuffix .o,$(MODULES)) +DEPS := $(addsuffix .d,$(MODULES)) + +buttress: $(OBJECTS) + $(CC) $(LFLAGS) -o buttress $(OBJECTS) + +%.o: $(SRC)%.c + $(CC) $(CFLAGS) -MD -c $< + +version.o: FORCE + $(CC) $(VDEF) -MD -c $(SRC)version.c + +FORCE: # phony target to force version.o to be rebuilt every time + +-include $(DEPS) + +endif -- cgit v1.1