# # The main targets that can be executed directly are: # clean remove built files from a configuration # all build all configurations # # Environment MKDIR=mkdir CP=cp CC=gcc CCC=g++ CXX=g++ # Object Directory OBJECTDIR=build # Target dir TARGETDIR=dist # Object Files OBJECTFILES= \ ${OBJECTDIR}/bronx_nagios.o \ ${OBJECTDIR}/bronx_listener_utils.o \ ${OBJECTDIR}/bronx_listener.o \ ${OBJECTDIR}/bronx_cmd_acceptor.o \ ${OBJECTDIR}/bronx.o \ ${OBJECTDIR}/bronx_thread.o \ ${OBJECTDIR}/bronx_listener_netutils.o \ ${OBJECTDIR}/bronx_log.o \ ${OBJECTDIR}/bronx_config.o \ ${OBJECTDIR}/bronx_admin.o \ ${OBJECTDIR}/bronx_processors.o \ ${OBJECTDIR}/bronx_utils.o \ ${OBJECTDIR}/bronx_cmd_acceptor_utils.o \ ${OBJECTDIR}/bronx_safe_fork.o # C Compiler Flags # _REENTRANT is defined in one of the Nagios header files that we include in all our # Bronx code, but let's not depend on that to guarantee the safety of our compilation. # _GNU_SOURCE is similarly defined in one of the Nagios header files, and again we # want to guarantee compatibility with that compilation, so we set it explictly here. CFLAGS=-D_REENTRANT -D_GNU_SOURCE -fPIC -Wall -Werror # Link Libraries and Options LDLIBSOPTIONS=-L/usr/local/groundwork/common/lib -lapr-1 -laprutil-1 -lmcrypt # Use the following as well to nail down linkages to GroundWork-supplied libraries. # LDLIBSOPTIONS+=-Wl,-R/usr/local/groundwork/common/lib # Header files INCLUDEFILES = \ -I/usr/local/groundwork/common/lib/glib-2.0/include/ \ -I/usr/local/groundwork/common/include/glib-2.0/ \ -I/usr/local/groundwork/common/include \ -I/usr/local/groundwork/common/include/apr-1 \ -I/usr/local/groundwork/common/include/nagios all : ${TARGETDIR}/libbronx.so ${TARGETDIR}/libbronx.so : ${OBJECTFILES} ${MKDIR} -p ${TARGETDIR} ${LINK.c} -shared -o ${TARGETDIR}/libbronx.so -fPIC ${OBJECTFILES} ${LDLIBSOPTIONS} # We could be more discriminating about exactly which header files are used to compile each # object file, but this thing as a whole compiles so quickly that there's no point in doing so. # The important thing is to at least establish some superset of the existing dependencies, so # we don't get misled into believing that everything is up-to-date when it's not. ${OBJECTFILES} : *.h ${OBJECTDIR}/%.o : %.c ${MKDIR} -p ${OBJECTDIR} $(COMPILE.c) -O2 ${INCLUDEFILES} ${CFLAGS} -o $@ $(*F).c clean : ${RM} -r ${OBJECTDIR} ${TARGETDIR} ${RM} ${TARGETDIR}/libbronx.so