~ubuntu-branches/ubuntu/precise/crossroads/precise

« back to all changes in this revision

Viewing changes to xr/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Ritter
  • Date: 2010-07-05 16:27:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100705162700-0g08tfav8ee9y51u
Tags: upstream-2.65
ImportĀ upstreamĀ versionĀ 2.65

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
# Configuration 
 
3
DIRS             = $(shell find . -type d | grep -v '.svn')
 
4
BUILDDIR         = build
 
5
BIN              = $(BUILDDIR)/xr
 
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)
 
20
 
 
21
foo:
 
22
        $(MAKE) subdirs
 
23
        $(MAKE) $(BIN)
 
24
 
 
25
install: $(BINDIR)/xr
 
26
$(BINDIR)/xr: $(BUILDDIR)/xr
 
27
        cp $(BUILDDIR)/xr $(TMPXR)
 
28
        strip $(TMPXR)
 
29
        install $(TMPXR) $(BINDIR)/xr
 
30
        rm -f $(TMPXR)
 
31
 
 
32
subdirs: $(BUILDDIR)/usage.h $(BUILDDIR)/status.xslt.h
 
33
        @echo 'About to build in class dirs: $(DIRS)'
 
34
        @for f in $(DIRS) ; do \
 
35
           echo "Making: $$f"; \
 
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 \
 
44
             || exit 1; \
 
45
         done
 
46
        ar rs $(LIB) */*.o
 
47
        ranlib $(LIB)
 
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
 
54
 
 
55
$(BIN): $(BUILDDIR)/libxr.a
 
56
        $(CONF_CC) $(PROF) $(CONF_OPTFLAGS) -g -o $(BIN) \
 
57
          -L$(BUILDDIR) -lxr $(CONF_LIB)
 
58
 
 
59
clean:
 
60
        rm -f $(BIN) $(LIB) core obj/*.o etc/usage.h $(BUILDDIR)/config.cache
 
61
        find . -name \*.bak -exec rm {} \;
 
62