128 lines
3.8 KiB
Makefile
128 lines
3.8 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 the server
|
|
# and put it in operation at port used here because part
|
|
# of the client is generated using xml-rpc-api2cpp.
|
|
#
|
|
|
|
MD_URL= http://localhost:4243/RPC2
|
|
|
|
##### 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
|
|
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 $<
|
|
|
|
client/mdClientBehavior.cpp:
|
|
xml-rpc-api2cpp $(MD_URL) "behavior" mdClientBehavior >client/mdClientBehavior
|
|
bin/after client/mdClientBehavior mdClientBehavior\.cc >client/mdClientBehavior.cpp
|
|
bin/before client/mdClientBehavior mdClientBehavior\.cc >include/mdClientBehavior.h
|
|
rm src/client/mdClientBehavior
|
|
|
|
client/mdClientDevice.cpp:
|
|
xml-rpc-api2cpp $(MD_URL) "device" mdClientDevice >client/mdClientDevice
|
|
bin/after client/mdClientDevice mdClientDevice\.cc >client/mdClientDevice.cpp
|
|
bin/before client/mdClientDevice mdClientDevice\.cc >include/mdClientDevice.h
|
|
rm src/client/mdClientDevice
|
|
|
|
client/mdClientState.cpp:
|
|
xml-rpc-api2cpp $(MD_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
|
|
|
|
|
|
|
|
|