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.39 KB
Newer Older
1
#
Leigh B. Stoller's avatar
Leigh B. Stoller committed
2
# EMULAB-COPYRIGHT
3
# Copyright (c) 2000-2003 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 19
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
all: proxydhcp bootinfo 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/usr/local/include
32

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

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

46 47 48 49
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
50

51
bootinfo: bootinfo.o $(BI_DBOBJ)
52
	cc $(CFLAGS) $(DBFLAG) $(INCS) \
53 54 55 56 57 58
		-o bootinfo bootinfo.o $(BI_DBOBJ) \
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient

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

61 62 63 64
testbootinfo_cfile: bootinfo_cfile.c
	cc $(CFLAGS) -DUSE_CFILE_DB -DTEST $(INCS) -o testcfile $< $(LFLAGS)

testproxydhcp_mysql: proxydhcp_mysql.c
65 66
	cc $(CFLAGS) -DUSE_MYSQL_DB -DTEST $(INCS) \
		-o testmysql $< \
67 68
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient

69
testproxydhcp_cfile: proxydhcp_cfile.c
70
	cc $(CFLAGS) -DUSE_CFILE_DB -DTEST $(INCS) -o testcfile $< $(LFLAGS)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
71 72

install:	all
73

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

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