From 1ca65bf8104ebaeefeedfb5c4d1c32dc1f36c6ba Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Tue, 5 Jan 2010 17:34:48 +0200 Subject: [PATCH] open-osd: osd-target: Makefile support MacOSX/Darwin Define FreeBSD_Make=1 if compiled on FreeBSD or Darwin (Do this once in global Makedefs file) Use $(FreeBSD_Make) in conditional options needed on these platforms Inspired-by: John Chandy Signed-off-by: Boaz Harrosh --- Makedefs | 7 +++++++ osd-target/Makefile | 7 +++---- osd-util/Makefile | 3 +-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makedefs b/Makedefs index fbe7704..b6fef99 100644 --- a/Makedefs +++ b/Makedefs @@ -12,3 +12,10 @@ OPT := -O3 -DNDEBUG # vim: ft=make +UNAME= $(shell uname) +ifeq (FreeBSD,$(UNAME)) +FreeBSD_Make=1 +endif +ifeq (Darwin,$(UNAME)) +FreeBSD_Make=1 +endif diff --git a/osd-target/Makefile b/osd-target/Makefile index b48f905..03a47c9 100644 --- a/osd-target/Makefile +++ b/osd-target/Makefile @@ -2,6 +2,8 @@ # OSD target makefile # +-include ../Makedefs + SRC := attr.c db.c obj.c osd-schema.c osd.c cdb.c osd-sense.c list-entry.c SRC += osd-schema.c coll.c mtq.c INC := attr.h db.h obj.h osd-types.h osd.h cdb.h list-entry.h target-sense.h @@ -19,8 +21,7 @@ UTILLIB := ../osd-util/libosdutil.a IB_HW_OF_LIBS= -L/usr/local/openib-iser/lib -UNAME= $(shell uname) -ifeq (FreeBSD,$(UNAME)) +ifeq ($(FreeBSD_Make),1) LIBS += -L/usr/local/lib/ CFLAGS += -I/usr/local/include -I$(STGTDIR)/usr/bsd -I$(STGTDIR)/usr CFLAGS += -D__MAKE_BSD_BUILD__ @@ -29,8 +30,6 @@ endif LIBS += -lm -lcrypto -lsqlite3 -laio -lavahi-core -lavahi-common \ $(IB_HW_OF_LIBS) -libverbs -lrdmacm --include ../Makedefs - CC := gcc CPP_M := -MM LD := $(CC) diff --git a/osd-util/Makefile b/osd-util/Makefile index 3a86970..a94526b 100644 --- a/osd-util/Makefile +++ b/osd-util/Makefile @@ -18,8 +18,7 @@ CWARN := -Wall -W -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual \ -Wmissing-declarations -Wnested-externs CFLAGS := $(COPTS) $(CWARN) -I. -UNAME= $(shell uname) -ifeq (FreeBSD,$(UNAME)) +ifeq ($(FreeBSD_Make),1) CFLAGS += -I../tgt/usr/bsd ../tgt/usr endif