GNUmakefile.in 1.47 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

Leigh B. Stoller's avatar
Leigh B. Stoller committed
16
CFLAGS	+= -O -g -Wall -DUDP -I${OBJDIR} -I/usr/local/include
17

18
ifeq ($(EVENTSYS),1)
19
	TMCDCFLAGS = `elvin-config --cflags vin4c` \
20
		     -I$(TESTBED_SRCDIR)/event/lib -DEVENTSYS
21 22
	TMCDLIBS    = ${OBJDIR}/event/lib/libevent.a \
                          ${OBJDIR}/lib/libtb/libtb.a
23 24
	ELVINFLAGS = `elvin-config --libs vin4c`
endif
25

26

27
tmcd: tmcd.c ${TMCDLIBS} decls.h version.o
28
	$(CC) $(CFLAGS) $(TMCDCFLAGS) -o tmcd $< \
29
		version.o $(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient \
30 31
		$(ELVINFLAGS) $(TMCDLDFLAGS) $(TMCDLIBS)

32
tmcc: tmcc.o
33 34 35 36
	$(CC) $(CFLAGS) -g -o tmcc tmcc.o $(LFLAGS) -static

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

38
tmcc.o:	tmcc.c decls.h
39

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

43 44
install:	all

45 46
install:	$(INSTALL_SBINDIR)/tmcd \
		$(INSTALL_SBINDIR)/tmcd.restart
47 48 49 50 51 52

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

53 54 55 56 57 58 59 60 61
#
# 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 $<

62
clean: 
63
	rm -f *.o core tmcd tmcc findif version.c