~ubuntu-branches/ubuntu/edgy/logrotate/edgy

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Paul Martin
  • Date: 2004-06-11 13:51:34 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040611135134-xwwlztb186794ikt
Tags: 3.7-2
* Added commented out stuff in debian/rules to build a 
  logrotate-selinux package should Russell's move to get libselinux1 
  made "base" fail.
* Patch: 21-taboo-to-debug, reduces the "Ignoring..." messages of
  the taboo filter from ERROR to DEBUG. (Closes: #249073)
* Patch: 30-config-h, changed to fix upstream bug with mailing
  logs. (Closes: #253837)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
VERSION = $(shell awk '/Version:/ { print $$2 }' logrotate.spec)
 
2
CVSROOT = $(shell cat CVS/Root)
2
3
CVSTAG = r$(subst .,-,$(VERSION))
3
 
LFS = $(shell echo `getconf LFS_CFLAGS`)
4
 
CFLAGS = -Wall -D_GNU_SOURCE -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
 
4
OS_NAME = $(shell uname -s)
 
5
LFS = $(shell echo `getconf LFS_CFLAGS 2>/dev/null`)
 
6
CFLAGS = -Wall -D_GNU_SOURCE -D$(OS_NAME) -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
5
7
PROG = logrotate
6
 
BINDIR = /usr/sbin
7
 
MANDIR = /usr/share/man
8
8
MAN = logrotate.8
9
9
LOADLIBES = -lpopt
10
10
 
 
11
ifeq ($(WITH_SELINUX),yes)
 
12
CFLAGS += -DWITH_SELINUX
 
13
LOADLIBES += -lselinux 
 
14
endif
 
15
 
 
16
# HP-UX using GCC
 
17
ifeq ($(OS_NAME),HP-UX)
 
18
    ifeq ($(RPM_OPT_FLAGS),)
 
19
        RPM_OPT_FLAGS = -O2
 
20
    endif
 
21
    CC = gcc
 
22
    INSTALL = cpset
 
23
    ifeq ($(POPT_DIR),)
 
24
        POPT_DIR = /usr/local
 
25
    endif
 
26
    ifeq ($(HPLX_DIR),)
 
27
        HPLX_DIR = /usr/local/hplx
 
28
    endif
 
29
    LOADLIBES += -lhplx -L$(HPLX_DIR)/lib
 
30
    ifeq ($(BASEDIR),)
 
31
        BASEDIR = /usr/local
 
32
    endif
 
33
endif
 
34
 
 
35
# Solaris using gcc
 
36
ifeq ($(OS_NAME),SunOS)
 
37
    ifeq ($(RPM_OPT_FLAGS),)
 
38
        RPM_OPT_FLAGS = -O2
 
39
    endif
 
40
    CC = gcc
 
41
    INSTALL = install
 
42
    ifeq ($(BASEDIR),)
 
43
        BASEDIR = /usr/local
 
44
    endif
 
45
endif
 
46
 
 
47
# Red Hat Linux
 
48
ifeq ($(OS_NAME),Linux)
 
49
    INSTALL = install
 
50
    BASEDIR = /usr
 
51
endif
 
52
 
 
53
ifneq ($(POPT_DIR),)
 
54
    CFLAGS += -I$(POPT_DIR)
 
55
    LOADLIBES += -L$(POPT_DIR)
 
56
endif
 
57
 
 
58
ifneq ($(STATEFILE),)
 
59
    CFLAGS += -DSTATEFILE=\"$(STATEFILE)\"
 
60
endif
 
61
 
 
62
BINDIR = $(BASEDIR)/sbin
 
63
MANDIR = $(BASEDIR)/man
 
64
 
11
65
#--------------------------------------------------------------------------
12
66
 
13
67
OBJS = logrotate.o log.o config.o basenames.o
31
85
$(PROG): $(OBJS)
32
86
 
33
87
clean:
34
 
        rm -f $(OBJS) $(PROG) core*
 
88
        rm -f $(OBJS) $(PROG) core* .depend
35
89
 
36
90
depend:
37
91
        $(CPP) $(CFLAGS) -M $(SOURCES) > .depend
38
92
 
39
93
.PHONY : test
40
 
test:
 
94
test: $(TARGET)
41
95
        (cd test; ./test)
42
96
 
43
97
install:
45
99
        [ -d $(PREFIX)/$(MANDIR) ] || mkdir -p $(PREFIX)/$(MANDIR)
46
100
        [ -d $(PREFIX)/$(MANDIR)/man8 ] || mkdir -p $(PREFIX)/$(MANDIR)/man8
47
101
 
48
 
        install -s -m 755 $(PROG) $(PREFIX)/$(BINDIR)
49
 
        install -m 644 $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"`/$(MAN)
 
102
        if [ "$(OS_NAME)" = HP-UX ]; then \
 
103
        $(INSTALL) $(PROG) $(PREFIX)/$(BINDIR) 0755 bin bin; \
 
104
        $(INSTALL) $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"` 0644 bin bin; \
 
105
        else \
 
106
        $(INSTALL) -m 755 $(PROG) $(PREFIX)/$(BINDIR); \
 
107
        $(INSTALL) -m 644 $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"`/$(MAN); \
 
108
        fi
50
109
 
51
110
co:
52
111
        co RCS/*,v
53
112
        (cd examples; co RCS/*,v)
54
113
 
55
114
cvstag:
56
 
        cvs tag -F $(CVSTAG) .
 
115
        cvs tag -cF $(CVSTAG) .
57
116
 
58
117
archive: cvstag
59
118
        @rm -rf /tmp/logrotate-$(VERSION) /tmp/logrotate
60
 
        @cd /tmp; cvs export -r$(CVSTAG) logrotate; mv logrotate logrotate-$(VERSION)
 
119
        @cd /tmp; cvs -d $(CVSROOT) export -r$(CVSTAG) logrotate; mv logrotate logrotate-$(VERSION)
61
120
        @cd /tmp/logrotate-$(VERSION)
62
121
        @cd /tmp; tar czSpf logrotate-$(VERSION).tar.gz logrotate-$(VERSION)
63
122
        @rm -rf /tmp/logrotate-$(VERSION)