Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Makefile: Change exe name according to back-end built
There are 2 Makefile parameters that can change the type of OSD back-end
built:
PANASAS_OSD=0/1
PANASAS_OSDSIM=0/1 (ignored when PANASAS_OSD=0)

According to these parameters there are three possible executable names:
otgtd		- The default original backend (highly recommended)
pan_tgtd	- For use on Panasas OSDFS mount, usually compiled for
		  FreeBSD
pansim_tgtd	- For Panasas simulator OSD targets. Can be a Linux or
		  FreeBSD build.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
  • Loading branch information
Boaz Harrosh committed Jul 13, 2010
1 parent 4dd6621 commit 3ea2ff6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions Makedefs
Expand Up @@ -6,6 +6,10 @@
OPT := -O3 -DNDEBUG
# OPT := -O3

# Backend configuration flags
# PANASAS_OSD=1
# PANASAS_OSDSIM=1 # (ignored if PANASAS_OSD=0)

# Define this to build a pvfs2-server executable with an embedded OSD target
# inside it.
#PVFS_OSD_INTEGRATED := 1
Expand Down
14 changes: 12 additions & 2 deletions Makefile
@@ -1,5 +1,7 @@
# Top level Makefile to build everything

-include Makedefs

MK_PATH ?= $(PWD)
util := $(MK_PATH)/osd-util
tgt := $(MK_PATH)/tgt
Expand Down Expand Up @@ -28,15 +30,23 @@ target: util
target_clean:
$(MAKE) -C $(target) clean

OTGTD = otgtd
ifeq ($(PANASAS_OSD),1)
OTGTD = pan_tgtd
ifeq ($(PANASAS_OSDSIM),1)
OTGTD = pansim_tgtd
endif
endif

.PHONY: stgt stgt_checkpatch stgt_tgt_only stgt_clean
stgt: target
$(MAKE) OSDEMU=1 ISCSI=1 -C $(tgt)/usr
$(MAKE) OSDEMU=1 ISCSI=1 TGTD=$(OTGTD) -C $(tgt)/usr

stgt_checkpatch:
cd $(tgt);git show | $(CHECKPATCH) - | $(checkpatch_2_kdev) $(PWD)/$(tgt)

stgt_tgt_only:
$(MAKE) ISCSI=1 IBMVIO=1 ISCSI_RDMA=1 FCP=1 FCOE=1 OSDEMU=1 -C $(tgt)/usr
$(MAKE) ISCSI=1 IBMVIO=1 ISCSI_RDMA=1 FCP=1 FCOE=1 -C $(tgt)/usr

stgt_clean:
$(MAKE) -C $(tgt)/usr clean
Expand Down
6 changes: 1 addition & 5 deletions osd-target/Makefile
Expand Up @@ -2,10 +2,6 @@
# OSD target makefile
#

#configuration flags
PANASAS_OSD=1
PANASAS_OSDSIM=1

-include ../Makedefs

SRC := attr.c db.c obj.c osd-schema.c osd.c cdb.c osd-sense.c list-entry.c
Expand Down Expand Up @@ -87,7 +83,7 @@ $(STGTLIB): STGT
$(UTILLIB): UTIL
make -C $(UTILDIR)

%.o: %.c Makefile
%.o: %.c Makefile ../Makedefs
$(CC) $(CFLAGS) -c $< -o $@

osd-schema.c: osd.schema
Expand Down
3 changes: 2 additions & 1 deletion up
Expand Up @@ -8,12 +8,13 @@ BACKSTORE2=/usr0/var/osd-tgt/tgt-2/
BACKSTORE3=/usr0/var/osd-tgt/tgt-3/

TGTADM=./tgt/usr/tgtadm
OTGTD=./tgt/usr/otgtd
# -f - forgraound
# -d - debug level
# DEBUG="-d 9"
DEBUG=""

./tgt/usr/tgtd $DEBUG -f &
$OTGTD $DEBUG -f &

sleep 2
$TGTADM --lld iscsi --mode target --op new --tid 1 --targetname $(hostname)
Expand Down

0 comments on commit 3ea2ff6

Please sign in to comment.