GNUmakefile.in 1.31 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
CFLAGS	+= -O -g -DUDP -I${OBJDIR} -I/usr/local/include
17
ifeq ($(EVENTSYS),1)
18
	TMCDCFLAGS = $(CFLAGS) `elvin-config --cflags vin4c` \
19
		     -I$(TESTBED_SRCDIR)/event/lib -DEVENTSYS
20 21
	TMCDLIBS    = ${OBJDIR}/event/lib/libevent.a \
                          ${OBJDIR}/lib/libtb/libtb.a
22 23
	ELVINFLAGS = `elvin-config --libs vin4c`
endif
24

25

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

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

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

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

install:	all

41 42
install:	$(INSTALL_SBINDIR)/tmcd \
		$(INSTALL_SBINDIR)/tmcd.restart
43 44 45 46 47 48

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

49 50 51 52 53 54 55 56 57 58 59
#
# 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 $<



60
clean: 
61
	rm -f *.o core tmcd tmcc findif