GNUmakefile.in 2.07 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
		-DCONFPATH='"$(INSTALL_ETCDIR)/"' -DTBDBNAME='"$(TBDBNAME)"'
Leigh B. Stoller's avatar
Leigh B. Stoller committed
37

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

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

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

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

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

install:	all
65

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

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