140 lines
4.4 KiB
Makefile
140 lines
4.4 KiB
Makefile
LOCATION=authoring
|
|
#
|
|
# Add other locations and move target differences into the macros as needed
|
|
#
|
|
CC=g++
|
|
Cc=gcc
|
|
|
|
#---------------------------------------------------------------
|
|
# To build apig-cli, you must first build an XMLRPC entabled
|
|
# cliever and put it in operation at URL below because part
|
|
# of the generic core client generated using xml-rpc-api2cpp.
|
|
#--------------------------------------------------------------
|
|
CD_URL= http://localhost:4243/RPC2
|
|
#---------------------------------------------------------------
|
|
# You can build just CD without XMLRPC by leaving the DEF, LIB
|
|
# INCL variables out. Otherwise set them from xmlrpc-c-config.
|
|
#--------------------------------------------------------------
|
|
##### Set this to the location of the executables/objects to be produced
|
|
|
|
BUILD_OBJ_DIR = build
|
|
|
|
BOSTLIB=-L/usr/lib/boost
|
|
BOSINCL=-L/usr/include/boost
|
|
LOG4LIB=-L/usr/lib
|
|
|
|
#DEF_XML_RPC=-DXMLRPC-C
|
|
#XMLRPC_INCL=
|
|
#XMLRPC_LIB=
|
|
|
|
CLIENT=drde
|
|
|
|
SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) -l boost_system -l boost_thread -l log4cpp
|
|
|
|
ifeq ($(LOCATION),authoring)
|
|
SINCL= -I include -I ../AusRegCliever/include -I /usr/include/log4cpp $(BOSINCL)
|
|
CFLAGS= -DCURRENT_DEBUG=1000
|
|
endif
|
|
|
|
CLIBS= -L$(USRLIB)
|
|
|
|
CLFLAGS= -Wall -Wundef -Wpointer-arith -Wshadow \
|
|
-Wcast-align -Winline -Wmissing-declarations -Wredundant-decls \
|
|
-Wmissing-prototypes -Wnested-externs \
|
|
-Wstrict-prototypes -Waggregate-return -Wno-implicit
|
|
|
|
ACOBJS= build/cliever.o build/cdLogger.o build/clientDaemonConfig.o \
|
|
build/clientDaemon.o build/commander.o build/mdBehavior.o
|
|
|
|
|
|
# --- targets
|
|
#
|
|
|
|
ifeq ($(LOCATION),authoring)
|
|
all: cliever
|
|
endif
|
|
|
|
cliever: build/$(CLIENT)-cd
|
|
|
|
.c.o:
|
|
$(Cc) -c $(CLFLAGS) -o $<
|
|
|
|
#
|
|
# xmlrpc utils will create the following by reflection from a running cliever.
|
|
# this is only needed for APIG,
|
|
#
|
|
|
|
client/mdClientBehavior.cpp:
|
|
xml-rpc-api2cpp $(CD_URL) "behavior" mdClientBehavior >client/mdClientBehavior
|
|
after client/mdClientBehavior mdClientBehavior\.cc >client/mdClientBehavior.cpp
|
|
before client/mdClientBehavior mdClientBehavior\.cc >include/mdClientBehavior.h
|
|
rm src/client/mdClientBehavior
|
|
|
|
client/mdClientDevice.cpp:
|
|
xml-rpc-api2cpp $(CD_URL) "device" mdClientDevice >client/mdClientDevice
|
|
after client/mdClientDevice mdClientDevice\.cc >client/mdClientDevice.cpp
|
|
before client/mdClientDevice mdClientDevice\.cc >include/mdClientDevice.h
|
|
rm src/client/mdClientDevice
|
|
|
|
client/mdClientState.cpp:
|
|
xml-rpc-api2cpp $(CD_URL) "state" mdClientState >client/mdClientState
|
|
bin/after client/mdClientState mdClientState\.cc >client/mdClientState.cpp
|
|
bin/before client/mdClientState mdClientState\.cc >include/mdClientState.h
|
|
rm src/client/mdClientState
|
|
|
|
build/cdLogger.o: client/cdLogger.cpp include/cdLogger.h
|
|
$(CC) $(CFLAGS) client/cdLogger.cpp -c -o build/cdLogger.o $(SINCL)
|
|
|
|
build/cliever.o: client/ausreg-cd.cpp include/*.h
|
|
$(CC) $(CFLAGS) client/ausreg-cd.cpp -c -o build/cliever.o $(SINCL)
|
|
|
|
build/clientDaemonConfig.o: client/clientDaemonConfig.cpp include/*.h
|
|
$(CC) $(CFLAGS) client/clientDaemonConfig.cpp -c -o build/clientDaemonConfig.o $(SINCL)
|
|
|
|
build/clientDaemon.o: client/clientDaemon.cpp include/*.h
|
|
$(CC) $(CFLAGS) client/clientDaemon.cpp -c -o build/clientDaemon.o $(SINCL)
|
|
|
|
build/mdBehavior.o: client/mdBehavior.cpp include/mdBehavior.h
|
|
$(CC) $(CFLAGS) client/mdBehavior.cpp $(SINCL) -c -o build/mdBehavior.o
|
|
|
|
build/commander.o: client/commander.cpp include/mdCommander.h
|
|
$(CC) $(CFLAGS) client/commander.cpp $(SINCL) -c -o build/commander.o
|
|
|
|
build/$(CLIENT)-cd: $(ACOBJS)
|
|
$(CC) $(CFLAGS) -o build/$(CLIENT)-cd $(SINCL) $(LIBS) $(ACOBJS) $(SLIBS)
|
|
|
|
build/apig-cli: build/mdClientBehavior.o build/mdClientState.o build/mdClientDevice.o \
|
|
build/tools.o build/coretestbucket.o client/apig-cli.cpp
|
|
$(CC) $(CFLAGS) client/apig-cli.cpp $(CLIBS) $(CINCL) -o build/apig-cli build/tools.o build/coretestbucket.o \
|
|
build/mdClientBehavior.o build/mdClientState.o build/mdClientDevice.o
|
|
|
|
doxygen/index.html: etc/doxygen.config
|
|
doxygen etc/doxygen.config
|
|
|
|
# --- rebuild on copy to a new host
|
|
#distclean:
|
|
# clrbak
|
|
# rm -rf build
|
|
# rm -rf doxygen
|
|
# mkdir doxygen
|
|
# mkdir build
|
|
# touch etc/doxygen.config
|
|
|
|
|
|
.PHONY: ausreg_cd
|
|
ausreg_cd: build/$(CLIENT)-cd
|
|
|
|
.PHONY: dirs
|
|
dirs:
|
|
-mkdir -p $(BUILD_LIB_DIR)
|
|
|
|
clean:
|
|
clrbak
|
|
find ./build -name "*.o" -print | perl -ne "print;chop;unlink"
|
|
find ./build -name "*.rpo" -print | perl -ne "print;chop;unlink"
|
|
rm build/$(CLIENT)-cd
|
|
|
|
|
|
|
|
|