File: Makefile

package info (click to toggle)
logcheck 1.1.1-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 400 kB
  • ctags: 12
  • sloc: sh: 461; ansic: 150; makefile: 119
file content (119 lines) | stat: -rw-r--r-- 3,711 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Makefile for logcheck package.
# logtail.c : Log file tailing program
# 
# Send problems/code hacks to crowland@psionic.com or crowland@vni.net
# Thanks to rbulling@obscure.org for cleaning this Makefile up..
#

# Generic compiler
 CC = cc
# GNU..
# CC = gcc 

# Normal systems flags
CFLAGS = -O
# Braindead HPUX compiler flags
#CFLAGS = -O -Aa

# If you change these be sure you edit logcheck.sh to reflect
# the new paths!!

# This is where keyword files go.
#-- debianized by Rene Mayrhofer, 10.May 1999
INSTALLDIR = ${DESTDIR}/etc/logcheck

# This is where logtail will go
#-- debianized by Rene Mayrhofer, 10.May 1999
#-- changed so that logtail will go into /sbin, 19.Nov. 1999
INSTALLDIR_BIN = ${DESTDIR}/usr/sbin

# Some people want the logcheck.sh in /usr/local/bin. Uncomment this
# if you want this. /usr/local/etc was kept for compatibility reasons.
#-- debianized by Rene Mayrhofer, 10.May 1999
#-- changed so that logcheck.sh will go into /sbin, 19.Nov. 1999
INSTALLDIR_SH = ${DESTDIR}/usr/sbin
#INSTALLDIR_SH = /usr/local/etc

# The scratch directory for logcheck files.
#-- debianized by Rene Mayrhofer, 10.May 1999
TMPDIR = ${DESTDIR}/var/state/logcheck

# Debug mode for logtail
# CFLAGS = -g -DDEBUG

all:
		@echo "Usage: make <systype>"
		@echo "<systype> is one of: "
		@echo "  linux, bsdos, freebsd, sun, generic, hpux, digital"
		@echo "" 
		@echo "NOTE: This will make and install the package in these" 
		@echo "      directories:" 
		@echo "        logcheck configuration files : $(INSTALLDIR)" 
		@echo "        logcheck.sh shell script     : $(INSTALLDIR_SH)" 
		@echo "        logtail program              : $(INSTALLDIR_BIN)" 
		@echo "" 
		@echo "Edit the makefile if you wish to change these paths." 
		@echo "Any existing files will be overwritten."

clean:		
		/bin/rm ./src/logtail ./src/logtail.o

uninstall:	
		/bin/rm $(INSTALLDIR_SH)/logcheck.sh
		/bin/rm $(INSTALLDIR)/logcheck.ignore
		/bin/rm $(INSTALLDIR)/logcheck.hacking
		/bin/rm $(INSTALLDIR)/logcheck.violations
		/bin/rm $(INSTALLDIR)/logcheck.violations.ignore
		/bin/rm $(INSTALLDIR)/logcheck.conf
		/bin/rm $(INSTALLDIR_BIN)/logtail

install:	
		@echo "Making $(SYSTYPE)"
		$(CC) $(CFLAGS) -o ./src/logtail ./src/logtail.c
		@echo "Creating temp directory $(TMPDIR)"
#-- debianized by Rene Mayrhofer, 10.May 1999
		@if [ ! -d $(TMPDIR) ]; then /bin/mkdir -p $(TMPDIR); fi
		@echo "Setting temp directory permissions"
		chmod 700 $(TMPDIR)
		@echo "Copying files"
#-- debianized by Rene Mayrhofer, 10.May 1999
		@if [ ! -d $(INSTALLDIR) ]; then /bin/mkdir -p $(INSTALLDIR); fi 	
		@if [ ! -d $(INSTALLDIR_BIN) ]; then /bin/mkdir -p $(INSTALLDIR_BIN); fi 		
		cp ./systems/$(SYSTYPE)/logcheck.hacking $(INSTALLDIR)
		cp ./systems/$(SYSTYPE)/logcheck.violations $(INSTALLDIR)
		cp ./systems/$(SYSTYPE)/logcheck.violations.ignore $(INSTALLDIR)
		cp ./systems/$(SYSTYPE)/logcheck.ignore $(INSTALLDIR)
		cp ./systems/$(SYSTYPE)/logcheck.conf $(INSTALLDIR)
		cp ./systems/$(SYSTYPE)/logcheck.sh $(INSTALLDIR_SH)
		cp ./src/logtail $(INSTALLDIR_BIN)
		@echo "Setting permissions"
		chmod 700 $(INSTALLDIR_SH)/logcheck.sh
		chmod 700 $(INSTALLDIR_BIN)/logtail
		chmod 600 $(INSTALLDIR)/logcheck.violations.ignore
		chmod 600 $(INSTALLDIR)/logcheck.violations
		chmod 600 $(INSTALLDIR)/logcheck.hacking
		chmod 600 $(INSTALLDIR)/logcheck.ignore
		chmod 600 $(INSTALLDIR)/logcheck.conf
		@echo "Done. Don't forget to set your crontab."		

generic:		
		make install SYSTYPE=generic

linux:		
		make install SYSTYPE=linux

bsdos:		
		make install SYSTYPE=bsdos

freebsd:	
		make install SYSTYPE=freebsd

sun:		
		make install SYSTYPE=sun

hpux:		
		make install SYSTYPE=hpux

digital:		
		make install SYSTYPE=digital