Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "open-osd: Remove of OSC's osd-initiator"
This reverts commit 07d7d3b.

Conflicts:

	Makefile
  • Loading branch information
joc02012 committed Jun 3, 2012
1 parent 7d0e7d9 commit d013388
Show file tree
Hide file tree
Showing 55 changed files with 14,914 additions and 2 deletions.
31 changes: 29 additions & 2 deletions Makefile
Expand Up @@ -6,15 +6,23 @@ MK_PATH ?= $(PWD)
util := $(MK_PATH)/osd-util
tgt := $(MK_PATH)/tgt
target := $(MK_PATH)/osd-target
initiator := $(MK_PATH)/osd-initiator
CHECKPATCH ?= ~/dev/git/pub/scsi-misc/scripts/checkpatch.pl
checkpatch_2_kdev = checkpatch-2-kdev

.PHONY: all clean
# comment out any below to remove from compelation
all: target
all: stgt
all: target_test
# FreeBSD does not build initiator yet
ifneq ($(FreeBSD_Make),1)
all: initiator
all: initiator_tests
all: initiator_python
endif

clean: stgt_clean target_clean util_clean
clean: stgt_clean initiator_clean target_clean util_clean

.PHONY: util util_clean
util:
Expand All @@ -27,8 +35,27 @@ util_clean:
target: util
$(MAKE) -C $(target)

target_test: target
$(MAKE) -C $(target)/tests

target_clean:
$(MAKE) -C $(target) clean
$(MAKE) -C $(target)/tests clean

.PHONY: initiator initiator_tests initiator_python initiator_clean
initiator: util
$(MAKE) -C $(initiator)

initiator_tests: initiator
$(MAKE) -C $(initiator)/tests

initiator_python: initiator
$(MAKE) -C $(initiator)/python

initiator_clean:
$(MAKE) -C $(initiator)/python clean
$(MAKE) -C $(initiator)/tests clean
$(MAKE) -C $(initiator) clean

OTGTD = otgtd
ifeq ($(PANASAS_OSD),1)
Expand Down Expand Up @@ -59,7 +86,7 @@ dist:

# ctags generation for all projects
ctags:
ctags -R $(util) $(target) $(tgt) /usr/include
ctags -R $(util) $(target) $(initiator) $(tgt) /usr/include

osd_checkpatch:
git show | $(CHECKPATCH) - | $(checkpatch_2_kdev) $(PWD)
Expand Down
339 changes: 339 additions & 0 deletions osd-initiator/COPYING

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions osd-initiator/Makefile
@@ -0,0 +1,58 @@
#
# OSD initiator library
#

SRC := device.c sync.c drivelist.c command.c sense.c
INC := device.h sync.h drivelist.h command.h sense.h
OBJ := $(SRC:.c=.o)
LIB := libosdinit.a

-include ../Makedefs

CC := gcc
CPP_M := -MM
LD := $(CC)
COPTS := $(OPT) -fPIC
CWARN := -Wall -W -Wpointer-arith -Wwrite-strings -Wcast-align -Wcast-qual \
-Wbad-function-cast -Wundef -Wmissing-prototypes -Wstrict-prototypes \
-Wmissing-declarations -Wnested-externs
CFLAGS := $(COPTS) $(CWARN) -I..
#CFLAGS += -Dsg_io_v4=sg_io_v4_v2622
CFLAGS += -Dsg_io_v4=sg_io_v4_v2624

all:: $(LIB) $(OBJ)

$(LIB): $(OBJ)
ar cr $@ $^

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

ifeq (,$(filter clean distclean dist,$(MAKECMDGOALS)))
-include .depend
endif
all:: .depend
.depend: $(SRC) $(INC) Makefile
@$(CC) $(CPP_M) $(CFLAGS) $(SRC) > .depend

clean:
rm -f $(LIB) $(OBJ)
rm -f .depend

tags: FORCE
ctags $(SRC) $(INC)

FORCE:;

# distribution tarball
.PHONY: dist
MV := osd-initiator
MVD := $(MV)-$(shell date +%Y%m%d)
dist:
rm -rf $(MV) $(MVD)
mkdir $(MVD)
svn list -R | grep -v '/$$' | rsync --files-from=/dev/stdin ./ $(MVD)/
ln -s $(MVD) $(MV)
tar cf - $(MV) $(MVD) | bzip2 -9c > $(MVD).tar.bz2
rm -rf $(MV) $(MVD)

0 comments on commit d013388

Please sign in to comment.