File: Makefile

package info (click to toggle)
procmeter 2.5.1-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 260 kB
  • ctags: 197
  • sloc: ansic: 2,006; sh: 206; perl: 140; makefile: 106
file content (109 lines) | stat: -rw-r--r-- 3,240 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
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
# $Header: /home/amb/procmeter/RCS/Makefile 2.12 1998/02/09 18:36:03 amb Exp $
#
# ProcMeter - A simple performance monitor using /proc - Version 2.4c.
#
# Makefile.
#
# Written by Andrew M. Bishop
#
# This file Copyright 1994,95,96,97,98 Andrew M. Bishop
# It may be distributed under the GNU Public License, version 2, or
# any higher version.  See section COPYING of the GNU Public license
# for conditions under which this file may be redistributed.
#

CC=gcc

CFLAGS=-O2 -g -Wall
# Or you can set the syslog log facility and priority here (these are defaults).
#CFLAGS=-O2 -DSYSLOG_FACILITY=LOG_LOCAL7 -DSYSLOG_PRIORITY=LOG_INFO

XINCLUDE=-I/usr/X11R6/include

XLIB=-L/usr/X11R6/lib

INSTDIR=$(PREFIX)/usr/X11R6

COMPILE=$(CC) -c $(CFLAGS)

LINK=$(CC)
STRIP=strip

COMPILE_LINK=$(CC) $(CFLAGS)

OBJ     =procmeter.o      statistics.o xwindow.o log.o ProcMeter.o
OBJ_NO_X=procmeter-no-x.o statistics.o           log.o

########

procmeter : $(OBJ)
	$(LINK) $(OBJ) -o $@ $(XLIB) -lXaw -lXmu -lXt -lXext -lSM -lICE -lX11 || \
	$(LINK) $(OBJ) -o $@ $(XLIB) -lXaw -lXmu -lXt -lXext -lX11

procmeter-no-x : $(OBJ_NO_X)
	$(LINK) $(OBJ_NO_X) -o $@

demo : pipedemo
	@echo To see the demonstration program run:
	@echo start-procmeter pipedemo -- cpu sine

########

procmeter.o      : procmeter.c   procmeter.h
	$(COMPILE) $< -o $@
procmeter-no-x.o : procmeter.c   procmeter.h
	$(COMPILE) $< -o $@ -DNO_X
statistics.o     : statistics.c  procmeter.h
	$(COMPILE) $< -o $@
xwindow.o        : xwindow.c     procmeter.h ProcMeter.h
	$(COMPILE) $< -o $@ $(XINCLUDE)
log.o            : log.c         procmeter.h
	$(COMPILE) $< -o $@
ProcMeter.o      : ProcMeter.c               ProcMeter.h ProcMeterP.h
	$(COMPILE) $< -o $@ $(XINCLUDE)

########

pipedemo : pipedemo.c
	$(COMPILE_LINK) $< -o $@ -lm

########

clean :
	-rm -f *.o *~ pipedemo.d* start-procmeter.install

########

install :
	$(STRIP) procmeter
	sed -e "s%lib=./contrib%lib=/usr/X11R6/lib/X11/procmeter%" < start-procmeter > start-procmeter.install
	install -d $(INSTDIR)/bin
	install -d $(INSTDIR)/man/man1
	install -d $(INSTDIR)/lib/X11/app-defaults
	install -d $(INSTDIR)/lib/X11/procmeter
	install -m 755 procmeter $(INSTDIR)/bin
	install -m 644 procmeter.1 $(INSTDIR)/man/man1
	install -m 644 procmeter.ad $(INSTDIR)/lib/X11/app-defaults/ProcMeter
	install -m 755 start-procmeter.install $(INSTDIR)/bin/start-procmeter
	cd contrib ;\
	for f in * ; do \
	  [   -x $$f ] && install -m 755 $$f $(INSTDIR)/lib/X11/procmeter ;\
	  [ ! -x $$f ] && install -m 644 $$f $(INSTDIR)/lib/X11/procmeter ;\
	done ; exit 0
	install -m 755 procmeter-xlog $(INSTDIR)/bin

install-no-x :
	strip procmeter-no-x
	sed -e "s%lib=./contrib%lib=$(INSTDIR)/lib/procmeter%" < start-procmeter > start-procmeter.install
	install -d $(INSTDIR)/bin
	install -d $(INSTDIR)/man/man1
	install -d $(INSTDIR)/lib/procmeter
	install -m 755 procmeter-no-x $(INSTDIR)/bin
	install -m 644 procmeter.1 $(INSTDIR)/man/man1
	install -m 755 start-procmeter.install $(INSTDIR)/bin/start-procmeter
	cd contrib ;\
	for f in * ; do \
	  [   -x $$f ] && install -m 755 $$f $(INSTDIR)/lib/procmeter ;\
	  [ ! -x $$f ] && install -m 644 $$f $(INSTDIR)/lib/procmeter ;\
	done ; exit 0
	install -m 755 procmeter-xlog $(INSTDIR)/bin