Skip to content

Commit

Permalink
BUILD: chgs for gcc build
Browse files Browse the repository at this point in the history
  • Loading branch information
vageline committed Jan 19, 2017
1 parent 6d1c656 commit 5efba88
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 54 deletions.
32 changes: 21 additions & 11 deletions config.linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,32 @@

SHELL=/bin/bash

build:
${MAKE} cleanall
${MAKE} -j10 dep
${MAKE} -j10 code_pass
${MAKE} -j10 test
${MAKE} docs
${MAKE} packaging

ship:
${MAKE} dep
${MAKE} code_pass
${MAKE} -j10 dep
${MAKE} -j10 code_pass
@if [[ $(notdir $(PWD)) = test ]]; then ${MAKE} test; fi

docs: src/build/doxygen/doxygen.conf
rm -rf obj/doxygen/*
doxygen src/build/doxygen/doxygen.conf

tests:
${MAKE} ship
${MAKE} test
${MAKE} -j10 ship
${MAKE} -j10 test

run_fvt:
${MAKE} tests
${MAKE} -j10 tests
${MAKE} fvt

run_unit:
${MAKE} tests
${MAKE} -j10 tests
${MAKE} unit


#needed to provide linker rpath hints for installed code
DEFAULT_LIB_INSTALL_PATH = /opt/ibm/capikv/lib
#generate VPATH based on these dirs.
Expand Down Expand Up @@ -142,7 +147,7 @@ COMMONFLAGS += -O3
endif

#add support for the rev ID header
GITREVISION:=$(shell git rev-list HEAD | wc -l)-$(shell git rev-parse --short HEAD)
GITREVISION:=$(shell git rev-list HEAD 2>/dev/null| wc -l)-$(shell git rev-parse --short HEAD 2>/dev/null)
CUSTOMFLAGS += -DGITREVISION='"${GITREVISION}"'

#if ALLOW_WARNINGS is NOT defined, we assume we are compiling production code
Expand Down Expand Up @@ -377,11 +382,16 @@ fvt: ${SUBDIRS:.d=.fvt}
unit: ${SUBDIRS:.d=.unit}
beam: ${SUBDIRS:.d=.beamdir} ${BEAMOBJS}

docs: ${ROOTPATH}/src/build/doxygen/doxygen.conf
@rm -rf ${ROOTPATH}/obj/doxygen/*
@cd ${ROOTPATH}; doxygen src/build/doxygen/doxygen.conf

install:
rm -rf ${PKGDIR}/install_root/*
cd ${ROOTPATH}/src/build/install && ${MAKE}

packaging:
${MAKE} install
cd ${ROOTPATH}/src/build/packaging && ${MAKE}

cscope:
Expand Down
3 changes: 2 additions & 1 deletion src/build/doxygen/doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,8 @@ RECURSIVE = YES

EXCLUDE = */obj/* \
*/img/* \
*/.git/*
*/.git/* \
src/build/install/resources/license

# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
# directories that are symbolic links (a Unix filesystem feature) are excluded
Expand Down
73 changes: 33 additions & 40 deletions src/build/install/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,18 @@ IMAGEH="${_RESOURCEDIR}/1410*"
all:
rm -rf ${INSTALL_ROOT}
${MAKE} cflash cflash-test cflashimage
${INSTALL} ${_RESOURCEDIR}/cflash_configure ${PKGDIR}

cflash:
LIC_FILES := $(notdir $(shell ls ${_RESOURCEDIR}/license/*.txt 2>/dev/null))

${LIC_FILES}:
@mkdir -p ${_LIC_DIR}
ifeq ($(UNAME),AIX)
${INSTALL} ${_RESOURCEDIR}/license/$@ ${_LIC_DIR}
else
${INSTALL} -m 644 ${_RESOURCEDIR}/license/$@ ${_LIC_DIR}
endif

cflash: ${LIC_FILES}
@mkdir -p ${_BIN_DIR}
@mkdir -p ${_ETC_DIR}
@mkdir -p ${_LIB_DIR}
Expand Down Expand Up @@ -158,6 +167,7 @@ else
${INSTALL} -m 644 ${_RESOURCEDIR}/80-cxl.rules ${_UDEV_RULES_DIR}
${INSTALL} -m 644 ${_RESOURCEDIR}/80-cxlflash.rules ${_UDEV_RULES_DIR}

${INSTALL} ${_RESOURCEDIR}/cflash_configure ${_ETC_DIR}
${INSTALL} ${_RESOURCEDIR}/cxlffdc.debug ${_ETC_DIR}
${INSTALL} ${_RESOURCEDIR}/cxlffdc.cleardebug ${_ETC_DIR}
endif
Expand All @@ -177,9 +187,6 @@ ifeq ($(UNAME),AIX)
${INSTALL} ${ROOTPATH}/src/kv/test/run_kv_async.c ${_EXAMPLES_DIR}
${INSTALL} ${ROOTPATH}/src/kv/test/run_kv_sync.c ${_EXAMPLES_DIR}
${INSTALL} ${ROOTPATH}/src/kv/test/run_kv_persist.c ${_EXAMPLES_DIR}

@#Licenses
${INSTALL} ${_RESOURCEDIR}/license/*.txt ${_LIC_DIR}
else
${INSTALL} -m 644 ${ROOTPATH}/src/block/test/blockio.c ${_EXAMPLES_DIR}
${INSTALL} -m 644 ${ROOTPATH}/src/block/test/blocklistio.c ${_EXAMPLES_DIR}
Expand All @@ -188,9 +195,6 @@ else
${INSTALL} -m 644 ${ROOTPATH}/src/kv/test/run_kv_sync.c ${_EXAMPLES_DIR}
${INSTALL} -m 644 ${ROOTPATH}/src/kv/test/run_kv_persist.c ${_EXAMPLES_DIR}

@#Licenses
${INSTALL} -m 644 ${_RESOURCEDIR}/license/*.txt ${_LIC_DIR}

@#SystemD Daemons
${INSTALL} -m 644 ${_RESOURCEDIR}/cxlfd.service ${_SYSTEMD_DIR}

Expand All @@ -201,8 +205,15 @@ endif
@#Version tags and useful info
echo "${GITREVISION}" > ${INSTALL_ROOT}/version.txt

cflash-test:

MAN3_FILES := afu.h.3 cxl.h.3 capiblock.h.3 libcxl.h.3 arkdb.h.3 ark.h.3 cflash_tools_user.h.3
${MAN3_FILES}:
@mkdir -p ${_MAN_DIR}
@if [[ -e ${_DOCSRCDIR}/man/man3/$@ ]]; \
then echo ${INSTALL} ${_DOCSRCDIR}/man/man3/$@ ${_MAN_DIR};\
${INSTALL} ${_DOCSRCDIR}/man/man3/$@ ${_MAN_DIR}; fi

cflash-test: ${MAN3_FILES}
@#TEST ONLY CONTENT - DO NOT SHIP
@mkdir -p ${_TEST_DIR}
@mkdir -p ${_TEST_DATA_DIR}
Expand Down Expand Up @@ -258,34 +269,23 @@ else
${INSTALL} -s ${_RESOURCEDIR}/flashgt_nvme_override ${_TEST_DIR}
endif

ifeq ($(UNAME),AIX)
@#Manpages - this is highly repetative
else
@#seems like it could become its own make rule / recipe...
${INSTALL} ${_DOCSRCDIR}/man/man3/afu.h.3 ${_MAN_DIR}
${INSTALL} ${_DOCSRCDIR}/man/man3/cxl.h.3 ${_MAN_DIR}
${INSTALL} ${_DOCSRCDIR}/man/man3/capiblock.h.3 ${_MAN_DIR}
${INSTALL} ${_DOCSRCDIR}/man/man3/libcxl.h.3 ${_MAN_DIR}
${INSTALL} ${_DOCSRCDIR}/man/man3/arkdb.h.3 ${_MAN_DIR}
${INSTALL} ${_DOCSRCDIR}/man/man3/ark.h.3 ${_MAN_DIR}
${INSTALL} ${_DOCSRCDIR}/man/man3/cflash_tools_user.h.3 ${_MAN_DIR}
@#compress manpages in destination
gzip -f ${_MAN_DIR}/*.h.3
endif

cflashimage:
FW_FILES := $(notdir $(shell ls ${_RESOURCEDIR}/BTV*)) $(notdir $(shell ls ${_RESOURCEDIR}/1410*))

${FW_FILES}:
@mkdir -p ${_AFU_IMAGES_DIR}
#install if image PAPR header is promoted
ifneq ("$(wildcard ${_RESOURCEDIR}/1410*)","")
${INSTALL} ${_RESOURCEDIR}/1410* ${_AFU_IMAGES_DIR}
${INSTALL} ${_RESOURCEDIR}/BTV* ${_AFU_IMAGES_DIR}
@if [[ -e ${_RESOURCEDIR}/$@ ]];\
then echo ${INSTALL} ${_RESOURCEDIR}/$@ ${_AFU_IMAGES_DIR};\
${INSTALL} ${_RESOURCEDIR}/$@ ${_AFU_IMAGES_DIR}; fi
ifneq ($(UNAME),AIX)
cd ${_AFU_IMAGES_DIR}; /usr/bin/md5sum 1410* > afu_fw.md5sum; /usr/bin/md5sum *.bin >> afu_fw.md5sum
endif
@if [[ -e ${_RESOURCEDIR}/$@ ]];\
then cd ${_AFU_IMAGES_DIR}; /usr/bin/md5sum $@ >> afu_fw.md5sum; fi
endif
ifeq ($(UNAME),AIX)
# need to have a valid ffdc mechanism for AIX...
else #Linux only

cflashimage: ${FW_FILES}
@mkdir -p ${_AFU_IMAGES_DIR}
${INSTALL} ${_RESOURCEDIR}/cxlffdc ${AFU_ROOT}
ifneq ($(UNAME),AIX)
${INSTALL} -s ${_TESTSRCDIR}/cxl_afu_dump ${AFU_ROOT}
${INSTALL} -s ${_TESTSRCDIR}/cxl_afu_status ${AFU_ROOT}
${INSTALL} -s ${_TESTSRCDIR}/flashgt_temp ${AFU_ROOT}
Expand All @@ -299,17 +299,10 @@ else #Linux only
${INSTALL} ${_RESOURCEDIR}/cflash_stick.pl ${AFU_ROOT}
${INSTALL} ${_RESOURCEDIR}/cflash_perfcheck.pl ${AFU_ROOT}
${INSTALL} ${_RESOURCEDIR}/blacklist-cxlflash.conf ${AFU_ROOT}
${INSTALL} ${_RESOURCEDIR}/cxlffdc ${AFU_ROOT}
${INSTALL} ${_RESOURCEDIR}/flash_all_adapters ${AFU_ROOT}
${INSTALL} ${_RESOURCEDIR}/reload_all_adapters ${AFU_ROOT}
${INSTALL} ${_RESOURCEDIR}/psl_trace_dump ${AFU_ROOT}
${INSTALL} ${_RESOURCEDIR}/cxl_flash_vm ${AFU_ROOT}

#install if image without header is promoted
ifneq ("$(wildcard ${_RESOURCEDIR}/corsa*)","")
${INSTALL} ${_RESOURCEDIR}/corsa* ${_AFU_IMAGES_DIR}
endif

endif

include ${ROOTPATH}/config.mk
4 changes: 2 additions & 2 deletions src/test/afu.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void afu_unmap (struct afu *afu)
void afu_start (struct afu *afu)
{
/* Set WED in PSL and send start command to AFU */
debug ("Sending WED address 0x%016llx to PSL...\n", (__u64) afu->work.work_element_descriptor);
debug ("Sending WED address 0x%016lx to PSL...\n", (__u64) afu->work.work_element_descriptor);

if (ioctl (afu->fd, CXL_IOCTL_START_WORK, &afu->work) == 0) {
debug ("Start command succeeded on AFU\n");
Expand Down Expand Up @@ -262,7 +262,7 @@ void afu_mmio_read_dw (struct afu *afu, unsigned offset, __u64 *value)
{
__u64 addr = 4 * (__u64) (offset & ~0x1); // Force 8byte align
*value = in_be64 (afu->ps_addr + addr);
debug ("Read 0x%016llx from AFU register offset %x\n", *value, offset);
debug ("Read 0x%016lx from AFU register offset %x\n", *value, offset);
}

// Wait for AFU to complete job
Expand Down

0 comments on commit 5efba88

Please sign in to comment.