File: Makefile

package info (click to toggle)
jail 1:1.5-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 156 kB
  • ctags: 66
  • sloc: ansic: 481; makefile: 74; sh: 25
file content (50 lines) | stat: -rw-r--r-- 1,354 bytes parent folder | download | duplicates (2)
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
# $Id: Makefile,v 1.5 1998/08/03 14:07:31 ams Exp $
# Copyright 1998 ams@wiw.org (Abhijit Menon-Sen)
#

CC      = gcc
CFLAGS  = -Wall -O2
VERSION = 1.5
INSTALL = /usr/bin/install
STRIP   = /usr/bin/strip
DESTDIR = /usr
CONF    = $(CONFDIR)/etc
SBIN    = $(DESTDIR)/sbin
MANDIR  = $(DESTDIR)/man
DOCS    = README CREDITS TODO License INSTALL jail.lsm
MAN8    = icmplog.8 tcplog.8
MAN5    = icmplog.conf.5 tcplog.conf.5
SCONF   = icmplog.conf tcplog.conf
COMMON  = global.h common.h common.c
SRC     = icmplog.h tcplog.h icmplog.c tcplog.c Makefile
BIN     = icmplog tcplog
ICMCONF = $(CONF)/icmplog.conf
TCPCONF = $(CONF)/tcplog.conf
CONFSTR = -DICMPLOG_CONF='"$(ICMCONF)"' -DTCPLOG_CONF='"$(TCPCONF)"'
VERSTR  = -DVERSION='"$(VERSION)"'

jail: $(BIN)
	$(STRIP) $(BIN)

common.o: $(COMMON)
	$(CC) $(CFLAGS) -c -o common.o common.c

%: %.c %.h common.o
	$(CC) $(CFLAGS) $(CONFSTR) $(VERSTR) -o $@ $< common.o

install: $(BIN) $(MAN) $(SCONF)
	$(INSTALL) -s $(BIN) $(SBIN)
	-$(INSTALL) -m0644 $(MAN8) $(MANDIR)/man8
	-$(INSTALL) -m0644 $(MAN5) $(MANDIR)/man5
	-$(INSTALL) -m0644 $(SCONF) $(CONF)

dist: jail
	-mkdir jail-$(VERSION)
	-cp $(DOCS) $(MAN8) $(MAN5) $(COMMON) $(SCONF) $(SRC) $(BIN) jail-$(VERSION)
	tar czf jail-$(VERSION).tar.gz jail-$(VERSION)/*
	rm -rf jail-$(VERSION)

.PHONY: clean

clean:
	-rm -f $(BIN) *.o core *~ jail-$(VERSION).tar.gz