File: Makefile

package info (click to toggle)
mrtgutils 0.5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 80 kB
  • ctags: 34
  • sloc: ansic: 327; makefile: 73
file content (39 lines) | stat: -rw-r--r-- 897 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
CC = gcc
CFLAGS = -g -O2 -Wall 
VERSION = 0.1

ARCH:= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
ifeq ($(ARCH),i386)
WITH_SENSORS:=1
endif

COBJS = uptime.o util.o
TARGETS = mrtg-load mrtg-ip-acct mrtg-apache
MANPAGES = mrtg-load.1 mrtg-ip-acct.1 mrtg-apache.1
ifeq ($(WITH_SENSORS),1)
TARGETS += mrtg-sensors
MANPAGES += mrtg-sensors.1
endif

%.o: %.c
	$(CC) $(CFLAGS) -c $<

%.1: %.pod
	pod2man --center "MRTG helper utilities" --release "mrtgutils $(VERSION)" $^ > $@

all: $(TARGETS) $(MANPAGES)

mrtg-sensors: LIBS=-lsensors

mrtg-%: $(COBJS) mrtg-%.o
	$(CC) $(CFLAGS) $(LIBS) -o $@ $^
	strip --strip-unneeded $@

install: $(TARGET) 
	for i in $(TARGETS); do install -m 755 $$i $(DESTDIR)/usr/bin/$$i; done
	for i in $(MANPAGES); do install -m 644 $$i $(DESTDIR)/usr/share/man/man1/$$i; gzip -9 $(DESTDIR)/usr/share/man/man1/$$i; done
	

clean:
	-rm -f *.o $(TARGETS) $(MANPAGES)
	-rm -f *~