GNUmakefile.in 2.48 KB
Newer Older
Kirk Webb's avatar
 
Kirk Webb committed
1
#
2
# Copyright (c) 2000-2014 University of Utah and the Flux Group.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
Kirk Webb's avatar
 
Kirk Webb committed
22
#
Leigh B Stoller's avatar
Leigh B Stoller committed
23 24 25 26
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= @top_builddir@
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
27
TBLIB		= $(TESTBED_LIBOBJDIR)/libtb/libtb.a
Kirk Webb's avatar
 
Kirk Webb committed
28 29 30 31 32 33 34

SBIN_SCRIPTS    = 
CDPROGS		= canaryd alertlistener

include $(OBJDIR)/Makeconf

CC?=gcc
35
CFLAGS+= -Wall -g -I${OBJDIR} \
36 37
		-I$(TESTBED_LIBSRCDIR)/libtb \
		-I$(TESTBED_LIBSRCDIR)/event \
Kirk Webb's avatar
 
Kirk Webb committed
38 39
		-DCLIENT_BINDIR='"$(CLIENT_BINDIR)"' \
		-DLOG_TESTBED=$(LOG_TESTBED) \
40
		-I/usr/local/include
41
LDFLAGS+= -L${TESTBED_LIBOBJDIR}/libtb -L/usr/local/lib/mysql -L${TESTBED_LIBOBJDIR}/event
42
LDFLAGS+= $(LDSTATIC)
43
LIBS+= -ltb -levent -lcrypto -L/usr/local/lib -lpubsub -lm
Kirk Webb's avatar
 
Kirk Webb committed
44 45 46 47 48 49 50 51
CP= cp -pf

SYSTEM  := $(shell uname -s)

all: $(CDPROGS) client

include ${TESTBED_SRCDIR}/GNUmakerules

52
canaryd: canaryd.o childProcess.o networkInterface.o canarydEvents.o auxfuncs.o version.o
53
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ canaryd.o childProcess.o networkInterface.o canarydEvents.o auxfuncs.o version.o $(LIBS) -ldevstat
Kirk Webb's avatar
 
Kirk Webb committed
54 55 56 57 58

alertlistener: alertlistener.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ alertlistener.o $(LIBS)

$(TBLIB):
59
	gmake -C ${TESTBED_LIBOBJDIR}
Kirk Webb's avatar
 
Kirk Webb committed
60

61
version.c: canaryd.c childProcess.h childProcess.c networkInterface.h networkInterface.c canarydEvents.h canarydEvents.c auxfuncs.c auxfuncs.h alertlistener.c
Kirk Webb's avatar
 
Kirk Webb committed
62 63 64 65
	echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"

client: canaryd

66 67
boss-install: $(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS) alertlistener) \
	feedbacklogs
Timothy Stack's avatar
 
Timothy Stack committed
68
	$(INSTALL_PROGRAM) feedbacklogs $(INSTALL_DIR)/opsdir/sbin/feedbacklogs
Kirk Webb's avatar
 
Kirk Webb committed
69 70

client-install: client
71
	$(INSTALL_PROGRAM) -s canaryd$(EXE) $(DESTDIR)$(CLIENT_BINDIR)$(EXE)
Kirk Webb's avatar
 
Kirk Webb committed
72

73
control-install:
Leigh B Stoller's avatar
Leigh B Stoller committed
74 75
mfs:
mfs-install:
76

Kirk Webb's avatar
 
Kirk Webb committed
77 78 79
clean:
	rm -f *.o $(CDPROGS) *~ core *.core version.c