From 69d684f700fdb1f778d8b440d79c24bb13a28d82 Mon Sep 17 00:00:00 2001 From: agibert Date: Tue, 15 Jul 2003 23:57:50 +0000 Subject: [PATCH] Update Makefile to Marc new system. --- demo/Makefile | 56 ++++++++++++++++++++++++++++++++++----------------- util/Makefile | 53 +++++++++++++++++++++++++++++++----------------- 2 files changed, 72 insertions(+), 37 deletions(-) diff --git a/demo/Makefile b/demo/Makefile index acacd18..8f9669c 100644 --- a/demo/Makefile +++ b/demo/Makefile @@ -1,27 +1,45 @@ -ifdef LIBVER_SUPPORT - DEP_STATIC += ../../libver/lib/ver.h ../../libver/lib/libver.a - DEP_DYNAMIC += ../../libver/lib/ver.h ../../libver/lib/libver.so - INCLUDE += -I ../../libver/lib +SRC := nddemo0.c +TARGETS := nddemo0 nddemo0-static +FILE_BIN := nddemo0 nddemo0-static +FILE_BIN := nddemo0 nddemo0-static +FILE_LIB := nddemo0.dat + + + +include ../Makefile.var +include ../Makefile.rule + + + +DEP_STATIC = ../lib/libnode.a +DEP_DYNAMIC = ../lib/libnode.so +INCLUDE = -I . -I ../include +LIBDIR = -L . -L ../lib +LIB_STATIC = ../lib/libnode.a +LIB_DYNAMIC = -lnode + +ifdef _LIBVER_SUPPORT + DEP_STATIC += ../../libver/ver.h ../../libver/libver.a + DEP_DYNAMIC += ../../libver/ver.h ../../libver/libver.so + INCLUDE += -I ../../libver/lib LIBDIR += -L ../../libver/lib - ifeq ($(OSTYPE),linux-gnu) - LIB_STATIC += ../../libver/lib/libver.a - LIB_DYNAMIC += -lver - else - LIB_STATIC += -ldl ../../libver/lib/libver.a - LIB_DYNAMIC += -ldl -lver - endif + ifeq ($(OSTYPE),linux-gnu) + LIB_STATIC += ../../libver/lib/libver.a + LIB_DYNAMIC += -lver + else + LIB_STATIC += -ldl ../../libver/lib/libver.a + LIB_DYNAMIC += -ldl -lver + endif - FLAG += -D_LIBVER_SUPPORT -rdynamic + CFLAGS += -D_LIBVER_SUPPORT -rdynamic endif -all: demo0 demo0-static -demo0-static: demo0.c $(DEP_STATIC) ../lib/node.h ../lib/libnode.a Makefile - gcc -g -o demo0-static $(FLAG) $(INCLUDE) -I ../lib demo0.c $(LIB_STATIC) ../lib/libnode.a -demo0: demo0.c $(DEP_DYNAMIC) ../lib/node.h ../lib/libnode.so Makefile - gcc -g -o demo0 $(FLAG) $(INCLUDE) -I ../lib $(LIBDIR) -L ../lib $(LIB_DYNAMIC) -lnode demo0.c +nddemo0-static: nddemo0.c $(DEP_STATIC) + $(CC) -o $@ $(CFLAGS) $(INCLUDE) $< $(LIB_STATIC) + +nddemo0: nddemo0.c $(DEP_DYNAMIC) + $(CC) -o $@ $(CFLAGS) $(INCLUDE) $(LIBDIR) $(LIB_DYNAMIC) $< -clean: - rm -f demo0 demo0-static diff --git a/util/Makefile b/util/Makefile index 2ecc673..b7988dc 100644 --- a/util/Makefile +++ b/util/Makefile @@ -1,27 +1,44 @@ -ifdef LIBVER_SUPPORT - DEP_STATIC += ../../libver/lib/ver.h ../../libver/lib/libver.a - DEP_DYNAMIC += ../../libver/lib/ver.h ../../libver/lib/libver.so +SRC := ndbench.c +TARGETS := ndbench-static ndbench +FILE_BIN := ndbench-static ndbench +FILE_DOC := ndbech.xls +FILE_LIB := test-10K.ndb test-100K.ndb test-1M.ndb test-all.ndb + + + +include ../Makefile.var +include ../Makefile.rule + + + +DEP_STATIC = ../lib/libnode.a +DEP_DYNAMIC = ../lib/libnode.so +INCLUDE = -I . -I ../include +LIBDIR = -L . -L ../lib +LIB_STATIC = ../lib/libnode.a +LIB_DYNAMIC = -lnode + +ifdef _LIBVER_SUPPORT + DEP_STATIC += ../../libver/ver.h ../../libver/libver.a + DEP_DYNAMIC += ../../libver/ver.h ../../libver/libver.so INCLUDE += -I ../../libver/lib LIBDIR += -L ../../libver/lib - ifeq ($(OSTYPE),linux-gnu) - LIB_STATIC += ../../libver/lib/libver.a - LIB_DYNAMIC += -lver - else - LIB_STATIC += -ldl ../../libver/lib/libver.a - LIB_DYNAMIC += -ldl -lver - endif + ifeq ($(OSTYPE),linux-gnu) + LIB_STATIC += ../../libver/lib/libver.a + LIB_DYNAMIC += -lver + else + LIB_STATIC += -ldl ../../libver/lib/libver.a + LIB_DYNAMIC += -ldl -lver + endif - FLAG_VER = -D_LIBVER_SUPPORT -rdynamic + CFLAGS += -D_LIBVER_SUPPORT -rdynamic endif -all: ndbench ndbench-static -ndbench-static: ndbench.c $(DEP_STATIC) ../lib/node.h ../lib/libnode.a Makefile - gcc -g -o ndbench-static $(FLAG_VER) $(INCLUDE) -I ../lib ndbench.c $(LIB_STATIC) ../lib/libnode.a -ndbench: ndbench.c $(DEP_DYNAMIC) ../lib/node.h ../lib/libnode.so Makefile - gcc -g -o ndbench -ldl $(FLAG_VER) $(INCLUDE) -I ../lib $(LIBDIR) -L ../lib $(LIB_DYNAMIC) -lnode ndbench.c +ndbench-static: ndbench.c $(DEP_STATIC) + $(CC) -o $@ $(CFLAGS) $(INCLUDE) $< $(LIB_STATIC) -clean: - rm -f ndbench ndbench-static +ndbench: ndbench.c $(DEP_DYNAMIC) + $(CC) -o $@ $(CFLAGS) $(INCLUDE) $(LIBDIR) $(LIB_DYNAMIC) $<