GNUmakefile.in 1.58 KB
Newer Older
1 2
#
# EMULAB-COPYRIGHT
Leigh B Stoller's avatar
Leigh B Stoller committed
3
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
4 5 6 7
# All rights reserved.
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
Leigh B Stoller's avatar
Leigh B Stoller committed
8 9
OBJDIR		= @top_builddir@
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))
10 11 12

include $(OBJDIR)/Makeconf

Timothy Stack's avatar
 
Timothy Stack committed
13
CFLAGS	= -Wall -O2 -g \
14 15
		  -I${OBJDIR} -I${TESTBED_SRCDIR}/lib/libtb
LIBS	= ${OBJDIR}/lib/libtb/libtb.a
Timothy Stack's avatar
 
Timothy Stack committed
16
LDFLAGS =
17
LDFLAGS  += $(LDSTATIC)
18

Timothy Stack's avatar
 
Timothy Stack committed
19 20
TESTS = $(SRCDIR)/syncd_test.sh

21 22 23 24
all:	emulab-syncd emulab-sync

include $(TESTBED_SRCDIR)/GNUmakerules

Timothy Stack's avatar
 
Timothy Stack committed
25 26
emulab-syncd-debug:	emulab-syncd.o version.o decls.h
	$(CC) $(CFLAGS) emulab-syncd.o version.o $(LDFLAGS) $(LIBS) -o $@
27

Timothy Stack's avatar
 
Timothy Stack committed
28 29
emulab-sync-debug:	emulab-sync.o version.o decls.h
	$(CC) $(CFLAGS) emulab-sync.o version.o $(LDFLAGS) $(LIBS) -o $@
30 31 32 33

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

Timothy Stack's avatar
 
Timothy Stack committed
34 35 36 37 38 39 40
install:
	-mkdir -p $(INSTALL_DIR)/opsdir/man/man1
	$(INSTALL) -m 644 $(SRCDIR)/emulab-syncd.1 \
		$(INSTALL_DIR)/opsdir/man/man1/emulab-syncd.1
	$(INSTALL) -m 644 $(SRCDIR)/emulab-sync.1 \
		$(INSTALL_DIR)/opsdir/man/man1/emulab-sync.1

41 42
client: all
client-install: client
Timothy Stack's avatar
 
Timothy Stack committed
43 44
	$(INSTALL_PROGRAM) emulab-syncd$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/emulab-syncd$(EXE)
	$(INSTALL_PROGRAM) emulab-sync$(EXE) $(DESTDIR)$(CLIENT_BINDIR)/emulab-sync$(EXE)
45
	$(INSTALL) -m 755 -o root -d $(DESTDIR)$(CLIENT_MANDIR)/man1
Timothy Stack's avatar
 
Timothy Stack committed
46 47
	$(INSTALL_DATA) $(SRCDIR)/emulab-syncd.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/emulab-syncd.1
	$(INSTALL_DATA) $(SRCDIR)/emulab-sync.1 $(DESTDIR)$(CLIENT_MANDIR)/man1/emulab-sync.1
48

49
clean:
Mike Hibler's avatar
Mike Hibler committed
50
	rm -f *.o emulab-syncd emulab-sync version.c
51