File: Makefile

package info (click to toggle)
gtkcookie 0.4-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 400 kB
  • ctags: 202
  • sloc: ansic: 3,023; makefile: 106
file content (60 lines) | stat: -rw-r--r-- 1,680 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
# what base directory do you want for the installation?
INSTPREFIX ?= /usr/local

# your gcc compiler
CC ?= /usr/local/bin/gcc

# define macros for gcc flags
CFLAGS_COMPAT ?= -D_XOPEN_SOURCE
CFLAGS_GTK_PKGCONFIG := $(shell pkg-config --cflags gtk+-2.0)
CFLAGS_GTK ?= ${CFLAGS_GTK_PKGCONFIG}
CFLAGS_WARN ?= -Wall
CFLAGS ?= -g
# with optimisation, and without debugging information...
# CFLAGS ?= -O3

# combine the lot
CFLAGS += ${CFLAGS_COMPAT} ${CFLAGS_GTK} ${CFLAGS_WARN}

# define libraries to include
LIBRARIES := $(shell pkg-config --libs gtk+-2.0)
# statically link libraries
# LIBRARIES = -static `gtk-config --libs`
# electric fence -- enable static linking to ensure this works
# LIBRARIES = `gtk-config --libs` -lefence

INSTALL = install -o root -g root

HEADERFILES = proctool.h getline.h

# the default target is all:, so that if you just say "make", all: is
# executed

all: gtkcookie

gtkcookie: gtkcookie.o proctool.o getline.o
	$(CC) $(LDFLAGS) -o gtkcookie gtkcookie.o proctool.o getline.o $(LIBRARIES)

gtkcookie.o: gtkcookie.c $(HEADERFILES)
	$(CC) $(CFLAGS) -c gtkcookie.c

proctool.o: proctool.c $(HEADERFILES)
	$(CC) $(CFLAGS) -c proctool.c

getline.o: getline.c $(HEADERFILES)
	$(CC) $(CFLAGS) -c getline.c

install: gtkcookie
	$(INSTALL) -d -m 755 $(INSTPREFIX)/bin
	$(INSTALL)    -m 755 gtkcookie $(INSTPREFIX)/bin
	$(INSTALL) -d -m 755 $(INSTPREFIX)/share/pixmaps
	$(INSTALL)    -m 644 cookie.xpm $(INSTPREFIX)/share/pixmaps
	$(INSTALL)    -m 644 small_cookie.xpm $(INSTPREFIX)/share/pixmaps
	$(INSTALL) -d -m 755 $(INSTPREFIX)/share/man/man1
	$(INSTALL)    -m 644 gtkcookie.1 $(INSTPREFIX)/share/man/man1

clean:
	rm -f gtkcookie
	rm -f *.o
	rm -f *~