aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2006-06-06 11:52:20 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2006-06-06 11:52:20 +0000
commit81dd6aadefa06530e4faf804c8ca4352c86232c9 (patch)
treef393e81d39bf292bb37a22ba2a0e25635cdc014f /src/Makefile
parentc741b3433355b4c8a73975bc06f6caac6b2c4440 (diff)
added build (and configure) target for compilation as single externals (as opposed to 1 big library)
svn path=/trunk/externals/zexy/; revision=5174
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index e0b3c25..60dd75f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -44,17 +44,30 @@ endif
TARGETS = $(SOURCES:.c=.o)
+OBJECTS = $(SOURCES:.c=)
+## if $(BUILDLIBRARY) is defined, we build everything as a single library
+## else we build separate externals
+ifneq "$(BUILDLIBRARY)" ""
all: $(LIBNAME)
cp $(LIBNAME).$(EXT) ..
+else
+all: externals
+endif
+
+
+$(OBJECTS): $(TARGETS)
+ $(LD) $(LFLAGS) -o $@.$(EXT) $@.o $(LIBS)
+ $(STRIP) $(STRIPFLAGS) $@.$(EXT)
$(LIBNAME): $(TARGETS) z_zexy.c z_zexy.h
- $(LD) $(LFLAGS) -o $(LIBNAME).$(EXT) *.o $(LIBS)
- $(STRIP) $(STRIPFLAGS) $(LIBNAME).$(EXT)
+ $(LD) $(LFLAGS) -o $@.$(EXT) *.o $(LIBS)
+ $(STRIP) $(STRIPFLAGS) $@.$(EXT)
$(TARGETS): %.o : %.c
$(CC) $(Z_CFLAGS) -c -o $@ $*.c
+externals: $(OBJECTS)
clean:
-rm -f *.$(EXT) *.o