All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

GNUmakefile.in 2.38 KB
Newer Older
1
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2004 University of Utah and the Flux Group.
Leigh B. Stoller's avatar
Leigh B. Stoller committed
4
# All rights reserved.
5
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
6

7 8 9 10
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= pxe
11
EVENTSYS        = @EVENTSYS@
12

13
include $(OBJDIR)/Makeconf
14

15 16 17 18
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
19
all: bootinfo bootinfosend bootinfo.restart
20

21
include $(TESTBED_SRCDIR)/GNUmakerules
Leigh B. Stoller's avatar
Leigh B. Stoller committed
22

23 24 25
DBFLAG	= -DUSE_MYSQL_DB
#DBFLAG = -DUSE_CFILE_DB
#DBFLAG = -DUSE_NULL_DB
26 27
BI_DBSRC   = bootinfo_null.c bootinfo_cfile.c bootinfo_mysql.c
BI_DBOBJ   = bootinfo_null.o bootinfo_cfile.o bootinfo_mysql.o
28

29
INCS    = -I${OBJDIR} -I/usr/local/include -I$(TESTBED_SRCDIR)/lib/libtb
30

31 32 33 34 35 36
CFLAGS	+= -Wall \
	$(INCS) $(DBFLAG) -DSOLARIS -DHAVE_SOCKADDR_SA_LEN -DUSE_RECVMSG \
	-DCONFPATH='"$(INSTALL_ETCDIR)/"' -DTBDBNAME='"$(TBDBNAME)"' \
	-DFALLBACK_HOST='"$(BOSSNODE)"' -DBOSSNODE='"$(BOSSNODE)"' \
	-DDEFAULT_PATH='"/tftpboot/pxeboot.newnode"' \
	-DLOG_TESTBED=$(LOG_TESTBED)
37

38 39
LFLAGS	=  ${OBJDIR}/lib/libtb/libtb.a

40
ifeq ($(EVENTSYS),1)
41 42 43
BI_DBSRC += event-support.c
BI_DBOBJ += event-support.o

44 45
CFLAGS  += -DEVENTSYS -I$(TESTBED_SRCDIR)/event/lib \
		`elvin-config --cflags vin4c`
46
LFLAGS  += $(OBJDIR)/event/lib/libevent.a `elvin-config --libs vin4c` -lcrypto
47
endif
Leigh B. Stoller's avatar
Leigh B. Stoller committed
48

49 50 51 52 53 54
bootinfo: bootinfo.o bootinfo.h bootinfo_version.o bootwhat.h $(BI_DBOBJ)
	cc $(CFLAGS) $(DBFLAG) $(INCS) \
		-o bootinfo bootinfo.o bootinfo_version.o $(BI_DBOBJ) \
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient

bootinfosend: bootinfosend.o bootinfo.h bootinfo_version.o bootwhat.h $(BI_DBOBJ)
55
	cc $(CFLAGS) $(DBFLAG) $(INCS) \
56
		-o bootinfosend bootinfosend.o bootinfo_version.o $(BI_DBOBJ) \
57 58
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient

59 60
bootinfo_mysql.o:	bootinfo.h bootwhat.h

61 62 63
testbootinfo_mysql: bootinfo_mysql.c
	cc $(CFLAGS) -DUSE_MYSQL_DB -DTEST $(INCS) \
		-o testmysql $< \
64 65
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient

66 67 68
testbootinfo_cfile: bootinfo_cfile.c
	cc $(CFLAGS) -DUSE_CFILE_DB -DTEST $(INCS) -o testcfile $< $(LFLAGS)

69 70 71 72
bootinfo_version.c: bootinfo.c bootinfo_mysql.c
	echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"


Leigh B. Stoller's avatar
Leigh B. Stoller committed
73
install:	all
74

75
install:	$(INSTALL_SBINDIR)/bootinfo \
76
		$(INSTALL_SBINDIR)/bootinfo.restart \
77
		$(INSTALL_SBINDIR)/bootinfosend \
78
		$(INSTALL_ETCDIR)/bootinfo.conf
Leigh B. Stoller's avatar
Leigh B. Stoller committed
79 80

clean: 
81
	rm -f *.o core bootinfo bootinfosend *.restart testmysql