Skip to content

Commit

Permalink
open-osd: osd-target: Makefile support MacOSX/Darwin
Browse files Browse the repository at this point in the history
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 <john.chandy@uconn.edu>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
  • Loading branch information
Boaz Harrosh committed Jan 7, 2010
1 parent 63c318a commit 1ca65bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 7 additions & 0 deletions Makedefs
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 3 additions & 4 deletions osd-target/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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__
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions osd-util/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1ca65bf

Please sign in to comment.