GNUmakefile.in 2.73 KB
Newer Older
1
2
#
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
4
5
6
7
8
9
10
# 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
SCRIPT_NSTB_COMPAT = /usr/testbed/lib/ns2ir/nstb_compat.tcl
19
20
21
22
23

SYSTEM	       := $(shell uname -s)

include $(OBJDIR)/Makeconf

24
all:	binaries $(SCRIPT) $(SCRIPT_RUN) $(SCRIPT_TBCOMPAT)
25
26
27
28
29
30
31
32
33

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
34
LIBS     += -levent -lcrypto -lssl
35
36
37
LIBS     += `elvin-config --libs vin4c`
ifeq ($(SYSTEM),Linux)
LIBS     += -ldl
38
LOCAL_BINDIR	= linux
39
40
endif

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


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

# 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)
57

58
binaries: $(LOCAL_BINDIR)/$(DAEMON) $(LOCAL_BINDIR)/$(LTEVENT) 
59

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

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

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

70
71
$(LTEVENT_OBJS): ../lib/libevent.a ../lib/event.h

72
# We install just enough to fire off the test from boss and wait. 
73
install:
74
75
76
77
	$(INSTALL_PROGRAM) $(LOCAL_BINDIR)/$(LTEVENT) $(INSTALL_LIBEXECDIR)
	$(INSTALL_PROGRAM) $(SCRIPT_RUN) $(INSTALL_BINDIR)

control-install:	install
78

79
80
81
client-install:
	$(INSTALL_PROGRAM)  $(LOCAL_BINDIR)/$(DAEMON) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON)
82
83
	$(INSTALL_PROGRAM)  $(LOCAL_BINDIR)/$(LTEVENT) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT)
84
85
	$(INSTALL_PROGRAM) $(SCRIPT) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT)
86
87
	$(INSTALL_PROGRAM) $(SCRIPT_RUN) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_RUN)
88
89
	$(INSTALL_PROGRAM) $(SCRIPT_TBCOMPAT) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_TBCOMPAT)
90
91
92
93
94
95
	$(INSTALL_PROGRAM) $(SCRIPT_NSTB_COMPAT) \
			$(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_NSTB_COMPAT)

lt-install:
	$(INSTALL_PROGRAM) $(SCRIPT) \
            $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT)
96
97
98

clean:
	/bin/rm -f *.o $(TESTS)
99
	/bin/rm -f $(LOCAL_BINDIR)/$(DAEMON)
100
101
102
	/bin/rm -f $(LOCAL_BINDIR)/$(LTEVENT)
	/bin/rm -f $(SCRIPT)
	/bin/rm -f $(SCRIPT_RUN)