GNUmakefile.in 1.67 KB
Newer Older
1 2 3
#
# Insert Copyright Here.
#
4 5
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
6
EVENTSYS	= @EVENTSYS@
7 8
OBJDIR		= ..
SUBDIR		= tmcd
9

10
include $(OBJDIR)/Makeconf
11

12
all:	tmcd tmcc tmcd.restart findif
13

14
include $(TESTBED_SRCDIR)/GNUmakerules
15

16 17 18 19 20 21 22
CFLAGS	+= -O -g -Wall -DUDP \
		-I${OBJDIR} -I/usr/local/include -I${TESTBED_SRCDIR}/lib/libtb
TMLIBS	 = ${OBJDIR}/lib/libtb/libtb.a

#
# For SSL enabled tmcd/tmcc
#
23
#CFLAGS	+= -DWITHSSL -DETCDIR='"$(INSTALL_ETCDIR)"'
24
#TMLIBS	+= -lssl -lcrypto
25
#SSLOBJ   = ssl.o
26

27
ifeq ($(EVENTSYS),1)
28
	TMCDCFLAGS = `elvin-config --cflags vin4c` \
29
		     -I$(TESTBED_SRCDIR)/event/lib -DEVENTSYS
30
	TMCDLIBS    = ${OBJDIR}/event/lib/libevent.a
31 32
	ELVINFLAGS = `elvin-config --libs vin4c`
endif
33

34
tmcd: tmcd.c ${TMCDLIBS} decls.h version.o $(SSLOBJ)
35
	$(CC) $(CFLAGS) $(TMCDCFLAGS) -o tmcd $< \
36 37 38
		version.o $(SSLOBJ) \
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient \
		$(ELVINFLAGS) $(TMCDLDFLAGS) $(TMCDLIBS) $(TMLIBS) 
39

40 41
tmcc: tmcc.o $(SSLOBJ)
	$(CC) $(CFLAGS) -g -o tmcc tmcc.o $(SSLOBJ) $(LFLAGS) -static $(TMLIBS)
42 43 44

findif: findif.o
	$(CC) $(CFLAGS) -g -o findif findif.o $(LFLAGS) -static
45

46
tmcc.o:	tmcc.c decls.h
47

48 49 50
version.c: tmcd.c
	echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"

51 52
install:	all

53 54
install:	$(INSTALL_SBINDIR)/tmcd \
		$(INSTALL_SBINDIR)/tmcd.restart
55 56 57 58 59 60

$(INSTALL_BINDIR)/tmcd/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_BINDIR)/tmcd
	$(INSTALL_PROGRAM) $< $@

61 62 63 64 65 66 67 68 69
#
# Here so that the event system libraries, and libraries they depend upon,
# can get made.
#
${OBJDIR}/event/lib/%:
	cd ${OBJDIR}/event/lib && gmake $<
${OBJDIR}/lib/libtb/%:
	cd ${OBJDIR}/lib/tbdb && gmake $<

70
clean: 
71
	rm -f *.o core tmcd tmcc findif version.c