GNUmakefile.in 2.23 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# All rights reserved.
#

SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ../..
SUBDIR		= event/linktest
11
12
13
LIBTBDIR    = $(OBJDIR)/lib/libtb
LIBEVENTDIR = ../lib
DAEMON	        = linktest
14
LTEVENT		= ltevent
15
SCRIPT		= linktest.pl
16
SCRIPT_RUN	= run_linktest.pl
17
SCRIPT_TBCOMPAT = tb_compat.tcl
18
19
20
21
22

SYSTEM	       := $(shell uname -s)

include $(OBJDIR)/Makeconf

23
all:	$(DAEMON) $(LTEVENT) $(SCRIPT) $(SCRIPT_RUN) $(SCRIPT_TBCOMPAT)
24
25
26
27
28
29
30
31
32

include $(TESTBED_SRCDIR)/GNUmakerules

CFLAGS   += -DDEBUG
CFLAGS	 += -O -g -static -Wall
CFLAGS   += -I. -I${OBJDIR} -I$(SRCDIR)/../lib -I$(TESTBED_SRCDIR)/lib/libtb
CFLAGS   += `elvin-config --cflags vin4c`

LDFLAGS  += -static -L../lib -L${OBJDIR}/lib/libtb
33
LIBS     += -levent -lcrypto -lssl
34
35
36
LIBS     += `elvin-config --libs vin4c`
ifeq ($(SYSTEM),Linux)
LIBS     += -ldl
37
LOCAL_BINDIR	= linux
38
39
endif

40
41
42
43
44
45
46
ifeq ($(SYSTEM),FreeBSD)
LOCAL_BINDIR	= fbsd
endif


LIBTB_OBJS	= $(LIBTBDIR)/log.o $(LIBTBDIR)/tbdefs.o
DAEMON_OBJS	= linktest.o
47
LTEVENT_OBJS	= ltevent.o
48
49
50
51
52
53
54
55

# Rules to make sure that some libraries we need from other directories get
# built first
$(LIBTBDIR)/%.o:
	@$(MAKE) -C $(LIBTBDIR) $(@F)

$(LIBEVENTDIR)/%.a:
	@$(MAKE) -C $(LIBEVENTDIR) $(@F)
56

57

58
59
60
$(DAEMON):	$(DAEMON_OBJS) $(LIBTB_OBJS)
	-mkdir $(LOCAL_BINDIR)
	$(CC) $(LDFLAGS) $(DAEMON_OBJS) $(LIBTB_OBJS) $(LIBS) -o $(LOCAL_BINDIR)/$@
61

62
63
64
65
$(LTEVENT):	$(LTEVENT_OBJS) $(LIBTB_OBJS)
	-mkdir $(LOCAL_BINDIR)
	$(CC) $(LDFLAGS) $(LTEVENT_OBJS) $(LIBTB_OBJS) $(LIBS) -o $(LOCAL_BINDIR)/$@

66
$(DAEMON_OBJS):	linktest.h ../lib/libevent.a ../lib/event.h
67

68
69
$(LTEVENT_OBJS): ../lib/libevent.a ../lib/event.h

70
71
install:

72
73
74
client-install:
	$(INSTALL_PROGRAM)  $(LOCAL_BINDIR)/$(DAEMON) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON)
75
76
	$(INSTALL_PROGRAM)  $(LOCAL_BINDIR)/$(LTEVENT) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT)
77
78
	$(INSTALL_PROGRAM) $(SCRIPT) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT)
79
80
	$(INSTALL_PROGRAM) $(SCRIPT_RUN) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_RUN)
81
82
	$(INSTALL_PROGRAM) $(SCRIPT_TBCOMPAT) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_TBCOMPAT)
83
84
85

clean:
	/bin/rm -f *.o $(TESTS)
86
	/bin/rm -f $(LOCAL_BINDIR)/$(DAEMON)
87
88
89
	/bin/rm -f $(LOCAL_BINDIR)/$(LTEVENT)
	/bin/rm -f $(SCRIPT)
	/bin/rm -f $(SCRIPT_RUN)