GNUmakefile.in 2.1 KB
Newer Older
1 2 3
#
# Insert Copyright Here.
#
4 5 6 7
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= pxe
8

9
include $(OBJDIR)/Makeconf
10

11 12 13 14 15
#
# 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
16

17
include $(TESTBED_SRCDIR)/GNUmakerules
Leigh B. Stoller's avatar
Leigh B. Stoller committed
18

19 20 21
DBFLAG	= -DUSE_MYSQL_DB
#DBFLAG = -DUSE_CFILE_DB
#DBFLAG = -DUSE_NULL_DB
22 23 24 25
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 
26

27
INCS    = -I/usr/local/include
28

29 30 31 32 33
#ifeq "$(filter -DLBS, $(CFLAGS))" "-DLBS"
#INCS   += -I/build/oskit-debug/install/include
#else
#INCS   += -I/n/moab/z/mike/flux/install.debug/include
#endif
34 35

CFLAGS	+= $(INCS) $(DBFLAG) -DSOLARIS -DHAVE_SOCKADDR_SA_LEN -DUSE_RECVMSG \
36 37
		-DCONFPATH='"$(INSTALL_ETCDIR)/"' -DTBDBNAME='"$(TBDBNAME)"' \
		-DFALLBACK_HOST='"$(BOSSNODE)"'
Leigh B. Stoller's avatar
Leigh B. Stoller committed
38

39 40 41 42
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
43

44
bootinfo: bootinfo.o $(BI_DBOBJ)
45
	cc $(CFLAGS) $(DBFLAG) $(INCS) \
46 47 48 49 50 51
		-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 $< \
52 53
		$(LFLAGS) -L/usr/local/lib/mysql -lmysqlclient

54 55 56 57
testbootinfo_cfile: bootinfo_cfile.c
	cc $(CFLAGS) -DUSE_CFILE_DB -DTEST $(INCS) -o testcfile $< $(LFLAGS)

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

62
testproxydhcp_cfile: proxydhcp_cfile.c
63
	cc $(CFLAGS) -DUSE_CFILE_DB -DTEST $(INCS) -o testcfile $< $(LFLAGS)
Leigh B. Stoller's avatar
Leigh B. Stoller committed
64 65

install:	all
66

67 68 69 70 71 72
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
73 74

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