3
DIRS = $(shell find . -type d | grep -v '.svn')
6
LIB = $(BUILDDIR)/libxr.a
7
TMPXR = /tmp/xr-$(shell whoami)
8
CONF_CC = $(shell etc/c-conf -c $(BUILDDIR)/config.cache c++-compiler)
9
CONF_OPTFLAGS = $(shell etc/c-conf -c $(BUILDDIR)/config.cache optflags)
10
CONF_LIB = $(shell etc/c-conf -c $(BUILDDIR)/config.cache \
11
lib ucb nsl pthread socket m alf)
12
CONF_GETOPT = $(shell etc/c-conf -c $(BUILDDIR)/config.cache \
13
ifheader getopt.h HAVE_GETOPT_H)
14
CONF_GETOPT_LONG = $(shell etc/c-conf -c $(BUILDDIR)/config.cache \
15
libfunction getopt_long HAVE_GETOPT_LONG)
16
CONF_INET_ATON = $(shell etc/c-conf -c $(BUILDDIR)/config.cache \
17
libfunction inet_aton HAVE_INET_ATON)
18
CONF_STRNSTR = $(shell etc/c-conf -c $(BUILDDIR)/config.cache \
19
libfunction strnstr HAVE_STRNSTR)
26
$(BINDIR)/xr: $(BUILDDIR)/xr
27
cp $(BUILDDIR)/xr $(TMPXR)
29
install $(TMPXR) $(BINDIR)/xr
32
subdirs: $(BUILDDIR)/usage.h $(BUILDDIR)/status.xslt.h
33
@echo 'About to build in class dirs: $(DIRS)'
34
@for f in $(DIRS) ; do \
36
BASE=$(BASE) CC=$(CONF_CC) BUILDDIR=$(BUILDDIR) VER='$(VER)' \
37
AUTHOR='$(AUTHOR)' MAINTAINER='$(MAINTAINER)' \
38
DISTSITE='$(DISTSITE)' MEMDEBUG=$(MEMDEBUG)\
39
CONF_CC='$(CONF_CC)' CONF_LIB='$(CONF_LIB)' \
40
CONF_GETOPT=$(CONF_GETOPT) CONF_GETOPT_LONG=$(CONF_GETOPT_LONG) \
41
CONF_INET_ATON=$(CONF_INET_ATON) CONF_OPTFLAGS='$(CONF_OPTFLAGS)' \
42
CONF_STRNSTR=$(CONF_STRNSTR) \
43
$(MAKE) -C $$f -f $(BASE)/xr/etc/Makefile.class \
48
$(BUILDDIR)/usage.h: etc/usage.txt
49
etc/e-txt2c USAGE <etc/usage.txt >$(BUILDDIR)/usage.h
50
touch config/parsecmdline.cc
51
$(BUILDDIR)/status.xslt.h: etc/status.xslt
52
etc/e-txt2c XSLT <etc/status.xslt >$(BUILDDIR)/status.xslt.h
53
touch webinterface/answerxslt.cc
55
$(BIN): $(BUILDDIR)/libxr.a
56
$(CONF_CC) $(PROF) $(CONF_OPTFLAGS) -g -o $(BIN) \
57
-L$(BUILDDIR) -lxr $(CONF_LIB)
60
rm -f $(BIN) $(LIB) core obj/*.o etc/usage.h $(BUILDDIR)/config.cache
61
find . -name \*.bak -exec rm {} \;