Commit 133ef5d8 authored by Scott Vokes's avatar Scott Vokes
Browse files

Import threadpool library

parent 8ca94af8
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ default: makedirs $(KINETIC_LIB)
makedirs:
	@echo; mkdir -p ./bin/examples &> /dev/null; mkdir -p ./bin/systest &> /dev/null; mkdir -p ./out &> /dev/null

all: default test system_tests run examples
all: default test system_tests test_internals run examples

clean: makedirs
	rm -rf ./bin/**
@@ -76,6 +76,8 @@ clean: makedirs
	bundle exec rake clobber
	git submodule update --init
	-./vendor/kinetic-simulator/stopSimulator.sh &> /dev/null;
	cd ${LIB_DIR}/threadpool && make clean
	cd ${LIB_DIR}/bus && make clean

TAGS: ${C_SRC} Makefile
	@find . -name "*.[ch]" | grep -v vendor | grep -v build | xargs etags
@@ -103,7 +105,7 @@ ${OUT_DIR}/kinetic_types.o: ${LIB_DIR}/kinetic_types_internal.h
${OUT_DIR}/*.o: src/lib/kinetic_types_internal.h


ci: uninstall all install
ci: uninstall all test_internals install
	@echo
	@echo --------------------------------------------------------------------------------
	@echo $(PROJECT) build completed successfully!
@@ -129,6 +131,9 @@ JAVA_BIN = $(JAVA_HOME)/bin/java

.PHONY: test

test_internals:
	cd ${LIB_DIR}/threadpool && make test
	cd ${LIB_DIR}/bus && make test

#-------------------------------------------------------------------------------
# Static and Dynamic Library Build Support
+0 −19
Original line number Diff line number Diff line
/*
* kinetic-c-client
* Copyright (C) 2014 Seagate Technology.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
/*
 * Copyright (c) 2011-2014 Scott Vokes <vokes.s@gmail.com>
 *
+4 −0
Original line number Diff line number Diff line
*.a
test_threadpool
*.o
*.dSYM/
+49 −0
Original line number Diff line number Diff line
PROJECT =	threadpool
OPTIMIZE =	-O3
WARN =		-Wall -pedantic #-Wextra
#CDEFS +=
#CINCS +=
CSTD +=		-std=c99 #-D_POSIX_C_SOURCE=1 -D_C99_SOURCE

CFLAGS +=	${CSTD} -g ${WARN} ${CDEFS} ${CINCS} ${OPTIMIZE}
LDFLAGS +=	-lpthread

TEST_CFLAGS = 	${CFLAGS}
TEST_LDFLAGS += ${LDFLAGS} -L. -lthreadpool

all: test_${PROJECT} 
all: test_${PROJECT}_stress
all: test_${PROJECT}_sequencing
all: lib${PROJECT}.a

OBJS=		threadpool.o

TEST_OBJS=	

# Basic targets

lib${PROJECT}.a: ${OBJS}
	ar -rcs lib${PROJECT}.a ${OBJS}

test_${PROJECT}: test_${PROJECT}.o ${TEST_OBJS} lib${PROJECT}.a
	${CC} -o $@ $^ ${TEST_CFLAGS} ${TEST_LDFLAGS}

test_${PROJECT}_%: test_${PROJECT}_%.o ${TEST_OBJS} lib${PROJECT}.a
	${CC} -o $@ $^ ${TEST_CFLAGS} ${TEST_LDFLAGS}

test: lib${PROJECT}.a ./test_${PROJECT}
	./test_${PROJECT}

clean:
	rm -f ${PROJECT} test_${PROJECT} test_${PROJECT}_stress *.o *.a *.core

# Installation
PREFIX ?=	/usr/local
INSTALL ?=	install
RM ?=		rm

install:
	${INSTALL} -c ${PROJECT} ${PREFIX}/bin

uninstall:
	${RM} -f ${PREFIX}/bin/${PROJECT}
+661 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading