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 3.17 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: proxydhcp bootinfo bootinfosend proxydhcp.restart 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 28 29
BI_DBSRC   = bootinfo_null.c bootinfo_cfile.c bootinfo_mysql.c
BI_DBOBJ   = bootinfo_null.o bootinfo_cfile.o bootinfo_mysql.o
PR_DBSRC   = proxydhcp_cfile.c proxydhcp_mysql.c 
PR_DBOBJ   = proxydhcp_cfile.o proxydhcp_mysql.o 
30

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

33 34 35 36 37 38
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)
39 40

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

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

50 51 52 53
proxydhcp: proxydhcp.o $(PR_DBOBJ)
	cc $(CFLAGS) $(DBFLAG) $(INCS) \
		-o proxydhcp proxydhcp.o $(PR_DBOBJ) \
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient
Leigh B. Stoller's avatar
Leigh B. Stoller committed
54

55 56 57 58 59 60
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)
61
	cc $(CFLAGS) $(DBFLAG) $(INCS) \
62
		-o bootinfosend bootinfosend.o bootinfo_version.o $(BI_DBOBJ) \
63 64
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient

65 66
bootinfo_mysql.o:	bootinfo.h bootwhat.h

67 68 69
testbootinfo_mysql: bootinfo_mysql.c
	cc $(CFLAGS) -DUSE_MYSQL_DB -DTEST $(INCS) \
		-o testmysql $< \
70 71
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient

72 73 74 75
testbootinfo_cfile: bootinfo_cfile.c
	cc $(CFLAGS) -DUSE_CFILE_DB -DTEST $(INCS) -o testcfile $< $(LFLAGS)

testproxydhcp_mysql: proxydhcp_mysql.c
76 77
	cc $(CFLAGS) -DUSE_MYSQL_DB -DTEST $(INCS) \
		-o testmysql $< \
78 79
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient

80
testproxydhcp_cfile: proxydhcp_cfile.c
81
	cc $(CFLAGS) -DUSE_CFILE_DB -DTEST $(INCS) -o testcfile $< $(LFLAGS)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
82

83 84 85 86 87 88 89
proxydhcp_version.c: proxydhcp.c proxydhcp_mysql.c
	echo >$@ "char build_info[] = \"Built `date +%d-%b-%Y` by `id -nu`@`hostname | sed 's/\..*//'`:`pwd`\";"

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
90
install:	all
91

92 93 94 95
install:	$(INSTALL_SBINDIR)/proxydhcp \
		$(INSTALL_SBINDIR)/proxydhcp.restart \
		$(INSTALL_SBINDIR)/bootinfo \
		$(INSTALL_SBINDIR)/bootinfo.restart \
96
		$(INSTALL_SBINDIR)/bootinfosend \
97 98
		$(INSTALL_ETCDIR)/proxydhcp.conf \
		$(INSTALL_ETCDIR)/bootinfo.conf
Leigh B. Stoller's avatar
Leigh B. Stoller committed
99 100

clean: 
101
	rm -f *.o core proxydhcp bootinfo *.restart testmysql