From 4e4a3922b02d5fe62e4411e2b17bd47c9e33da47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Wed, 23 Jan 2008 15:24:53 +0000 Subject: build aliases when not building a library svn path=/trunk/externals/iem/iemmatrix/; revision=9156 --- src/Makefile | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 1c95077..d304b02 100644 --- a/src/Makefile +++ b/src/Makefile @@ -7,11 +7,20 @@ default: all -include Make.config +VPATH = .:../alias/ + +## if $(BUILDLIBRARY) is defined, we need to include the aliases +ifeq "$(BUILDLIBRARY)" "" + ALIASOBJECTSOURCES=$(subst ../alias/,,$(sort $(filter %.c, $(wildcard ../alias/*.c)))) +else + ALIASOBJECTSOURCES= +endif + TESTDIR=../tests HELPERSOURCES=$(LIBRARY_NAME)_sources.c $(LIBRARY_NAME).c -OBJECTSOURCES=$(sort $(filter-out $(HELPERSOURCES), $(filter %.c, $(wildcard *.c)))) +OBJECTSOURCES=$(sort $(filter-out $(HELPERSOURCES), $(filter %.c, $(wildcard *.c)))) $(ALIASOBJECTSOURCES) SOURCES=$(OBJECTSOURCES) $(HELPERSOURCES) @@ -47,6 +56,13 @@ TARGETS = $(SOURCES:.c=.o) OBJECTS = $(OBJECTSOURCES:.c=.$(EXT)) + +debug: + @echo sources $(SOURCES) + @echo alias $(ALIASOBJECTSOURCES) + @echo targets $(TARGETS) + @echo objects $(OBJECTS) + ## if $(BUILDLIBRARY) is defined, we build everything as a single library ## else we build separate externals ifneq "$(BUILDLIBRARY)" "" @@ -65,7 +81,7 @@ $(LIBRARY_NAME): $(TARGETS) $(LIBRARY_NAME)_sources.c $(LIBRARY_NAME)_sources.h $(STRIP) $(STRIPFLAGS) $@.$(EXT) $(TARGETS): %.o : %.c - $(CC) $(LIBRARY_CFLAGS) -c -o $@ $*.c + $(CC) $(LIBRARY_CFLAGS) -c -o $@ $< externals: $(OBJECTS) -- cgit v1.2.1