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.37 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

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

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

48 49 50 51 52 53
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)
54
	cc $(CFLAGS) $(DBFLAG) $(INCS) \
55
		-o bootinfosend bootinfosend.o bootinfo_version.o $(BI_DBOBJ) \
56 57
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient

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

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

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

68 69 70 71
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
72
install:	all
73

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

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