DRDE/APIG/Makefile

140 lines
4.4 KiB
Makefile
Raw Normal View History

LOCATION=authoring
#
# Add other locations and move target differences into the macros as needed
#
CC=g++
Cc=gcc
2014-01-11 21:55:55 +00:00
#---------------------------------------------------------------
# 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.
#--------------------------------------------------------------
2014-01-11 19:34:15 +00:00
##### 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
2014-01-11 21:55:55 +00:00
#DEF_XML_RPC=-DXMLRPC-C
#XMLRPC_INCL=
#XMLRPC_LIB=
2014-01-11 19:34:15 +00:00
CLIENT=drde
SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) -l boost_system -l boost_thread -l log4cpp
ifeq ($(LOCATION),authoring)
2014-01-11 19:34:15 +00:00
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
2014-01-11 19:34:15 +00:00
ACOBJS= build/cliever.o build/cdLogger.o build/clientDaemonConfig.o \
build/clientDaemon.o build/commander.o build/mdBehavior.o
2014-01-11 20:42:13 +00:00
# --- targets
#
ifeq ($(LOCATION),authoring)
all: cliever
endif
2014-01-11 19:34:15 +00:00
cliever: build/$(CLIENT)-cd
.c.o:
$(Cc) -c $(CLFLAGS) -o $<
2014-01-11 20:42:13 +00:00
2014-01-11 21:55:55 +00:00
#
# xmlrpc utils will create the following by reflection from a running cliever.
# this is only needed for APIG,
#
2014-01-11 20:42:13 +00:00
client/mdClientBehavior.cpp:
2014-01-11 21:55:55 +00:00
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
2014-01-11 20:42:13 +00:00
rm src/client/mdClientBehavior
2014-01-11 20:42:13 +00:00
client/mdClientDevice.cpp:
2014-01-11 21:55:55 +00:00
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
2014-01-11 20:42:13 +00:00
rm src/client/mdClientDevice
client/mdClientState.cpp:
2014-01-11 21:55:55 +00:00
xml-rpc-api2cpp $(CD_URL) "state" mdClientState >client/mdClientState
2014-01-11 20:42:13 +00:00
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)
2014-01-11 19:34:15 +00:00
build/clientDaemon.o: client/clientDaemon.cpp include/*.h
$(CC) $(CFLAGS) client/clientDaemon.cpp -c -o build/clientDaemon.o $(SINCL)
2014-01-11 19:34:15 +00:00
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)
2014-01-11 19:56:19 +00:00
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
2014-01-11 19:34:15 +00:00
#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"
2014-01-11 19:34:15 +00:00
rm build/$(CLIENT)-cd