Update Makefile to Marc new system.

This commit is contained in:
agibert 2003-07-15 23:57:50 +00:00
parent a10f0b1cf5
commit 69d684f700
2 changed files with 72 additions and 37 deletions

View File

@ -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

View File

@ -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) $<