From 78e9d49e450b131de5f2b2be6b6b9f25fd5028b0 Mon Sep 17 00:00:00 2001 From: agibert Date: Fri, 17 Jan 2003 17:07:41 +0000 Subject: [PATCH] Improve libver support. --- demo/Makefile | 15 +++++++++++---- util/Makefile | 13 ++++++++++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/demo/Makefile b/demo/Makefile index 5de1fcd..b5c1528 100644 --- a/demo/Makefile +++ b/demo/Makefile @@ -3,18 +3,25 @@ ifdef _LIBVER_SUPPORT DEP_DYNAMIC += ../../libver/ver.h ../../libver/libver.so INCLUDE += -I ../../libver LIBDIR += -L ../../libver - LIB_STATIC += ../../libver/libver.a - LIB_DYNAMIC += -lver + + ifeq ($(OSTYPE),linux-gnu) + LIB_STATIC += ../../libver/libver.a + LIB_DYNAMIC += -lver + else + LIB_STATIC += -ldl ../../libver/libver.a + LIB_DYNAMIC += -ldl -lver + endif + FLAG += -D_LIBVER_SUPPORT 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 -ldl $(LIB_STATIC) ../lib/libnode.a + 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 -ldl $(LIB_DYNAMIC) -lnode demo0.c + gcc -g -o demo0 $(FLAG) $(INCLUDE) -I ../lib $(LIBDIR) -L ../lib $(LIB_DYNAMIC) -lnode demo0.c clean: rm -f demo0 demo0-static diff --git a/util/Makefile b/util/Makefile index 112b74a..cc43fc2 100644 --- a/util/Makefile +++ b/util/Makefile @@ -3,15 +3,22 @@ ifdef _LIBVER_SUPPORT DEP_DYNAMIC += ../../libver/ver.h ../../libver/libver.so INCLUDE += -I ../../libver LIBDIR += -L ../../libver - LIB_STATIC += ../../libver/libver.a - LIB_DYNAMIC += -lver + + ifeq ($(OSTYPE),linux-gnu) + LIB_STATIC += ../../libver/libver.a + LIB_DYNAMIC += -lver + else + LIB_STATIC += -ldl ../../libver/libver.a + LIB_DYNAMIC += -ldl -lver + endif + FLAG_VER = -D_LIBVER_SUPPORT 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 -ldl $(LIB_STATIC) ../lib/libnode.a + 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