Skip to content

Commit

Permalink
separation of modifyNc.cpp from the package
Browse files Browse the repository at this point in the history
  • Loading branch information
h-dh committed Aug 10, 2015
1 parent a9ab8ab commit 48669af
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Cx = diskUsage.x fModTime.x unixTime.x
CPPx = check_CORDEX_standard-table.x convert_CF-standard-names.x \
getNC_att.x getStatus.x modifyNc.x syncFiles.x testValidNC.x
getNC_att.x getStatus.x syncFiles.x testValidNC.x

UTIL_SOURCE = hdhC.cpp ReadLine.cpp Split.cpp Statistics.cpp GetOpt_hdh.cpp
UTIL_HEADER = hdhC.h matrix_array.h readline.h split.h statistics.h getopt_hdh.h
Expand Down Expand Up @@ -66,10 +66,3 @@ cf-checker.x: CF_main.cpp CF.cpp $(BASE_SOURCE) ${BASE_SOURCE} $(QA_HEADER) $(UT
$(CXX) $(CXXFLAGS) -o cf-checker.x $(QA_PATH)/src/CF_main.cpp \
-I $(QA_PATH)/include $(INCLUDE) \
$(LIB) $(LIBDL) -ludunits2 -lnetcdf -lhdf5_hl -lhdf5 -lz

ModifyNc: modifyNc.x

modifyNc.x: modifyNc.cpp modify_nc.h modify_fnct.cpp inquiry_fnct.cpp $(BASE_SOURCE) $(UTIL_SOURCE) $(UTIL_HEADER)
$(CXX) $(CXXFLAGS) -o modifyNc.x $(QA_PATH)/src/modifyNc.cpp \
-I $(QA_PATH)/include $(INCLUDE) \
$(LIB) $(LIBDL) -lnetcdf -lhdf5_hl -lhdf5 -lz -luuid
25 changes: 25 additions & 0 deletions Makefile_modify
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Makefile for the QA package

CPPx = modifyNc.x

UTIL_SOURCE = hdhC.cpp ReadLine.cpp Split.cpp Statistics.cpp GetOpt_hdh.cpp
UTIL_HEADER = hdhC.h matrix_array.h readline.h split.h statistics.h getopt_hdh.h

BASE_SOURCE = Annotation.cpp Base.cpp BraceOP.cpp Date.cpp \
InFile.cpp NcAPI.cpp TimeControl.cpp Variable.cpp
BASE_HEADER = annotation.h base.h brace_op.h data_statistics.h date.h \
geo_meta.h in_file.h iobj.h matrix_array.h nc_api.h \
time_control.h variable.h

#vpath %.c $(QA_PATH)/src
#vpath %.cpp $(QA_PATH)/src
#vpath %.h $(QA_PATH)/include

VPATH = $(QA_PATH)/src $(QA_PATH)/include
%.x: %.c
$(CC) $(CFLAGS) -o $@ $<

modifyNc.x: modifyNc.cpp modify_nc.h modify_fnct.cpp inquiry_fnct.cpp $(BASE_SOURCE) $(UTIL_SOURCE) $(UTIL_HEADER)
$(CXX) $(CXXFLAGS) -o modifyNc.x $(QA_PATH)/src/modifyNc.cpp \
-I $(QA_PATH)/include $(INCLUDE) \
$(LIB) $(LIBDL) -lnetcdf -lhdf5_hl -lhdf5 -lz -luuid
13 changes: 8 additions & 5 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ prg=install.sh
defaultProject=CORDEX
availableProjects=( CORDEX CMIP5 )

MAKEFILE=Makefile

compilerSetting()
{
# Notice priority
Expand Down Expand Up @@ -518,6 +520,7 @@ makeProject()
if [ ${PROJECT} = CF ] ; then
local cfc=CF-checker
elif [ ${PROJECT} = MODIFY ] ; then
MAKEFILE=Makefile_modify
local cfc=ModifyNc
else
if [ $(ps -ef | grep -c qa-DKRZ) -gt 1 ] ; then
Expand All @@ -531,11 +534,11 @@ makeProject()
fi
fi

if make ${always} -q -C $BIN -f ${QA_PATH}/Makefile ${cfc} ; then
if make ${always} -q -C $BIN -f ${QA_PATH}/$MAKEFILE ${cfc} ; then
test ${PROJECT} != CF && log "make qa-${PROJECT}.x" DONE=up-to-date
else
# not up-to-date
if make ${always} ${mk_D} -C $BIN -f ${QA_PATH}/Makefile ${cfc} ; then
if make ${always} ${mk_D} -C $BIN -f ${QA_PATH}/$MAKEFILE ${cfc} ; then
test ${PROJECT} != CF && log "make qa-${PROJECT}.x" DONE
else
test ${PROJECT} != CF && log "make qa-${PROJECT}.x" FAIL
Expand All @@ -554,18 +557,18 @@ makeProject()
makeUtilities()
{
# small utilities
if make ${always} -q -C $BIN -f ${QA_PATH}/Makefile c-prog cpp-prog ; then
if make ${always} -q -C $BIN -f ${QA_PATH}/$MAKEFILE c-prog cpp-prog ; then
status=$?
log "C/C++ utilities" DONE=up-to-date
else
# not up-to-date
# executes with an error, then again
text=$(make ${always} ${mk_D} \
-C $BIN -f ${QA_PATH}/Makefile c-prog cpp-prog 2>&1 )
-C $BIN -f ${QA_PATH}/$MAKEFILE c-prog cpp-prog 2>&1 )
if [ $? -gt 0 ]; then
export CFLAGS="${CFLAGS[*]} -DSTATVFS"
text=$(make ${always} ${mk_D} \
-C $BIN -f ${QA_PATH}/Makefile c-prog cpp-prog 2>&1 )
-C $BIN -f ${QA_PATH}/$MAKEFILE c-prog cpp-prog 2>&1 )
fi

status=$?
Expand Down

0 comments on commit 48669af

Please sign in to comment.