File: Makefile

package info (click to toggle)
aewm 1.3.12-3
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 356 kB
  • sloc: ansic: 2,557; makefile: 77; sh: 20
file content (99 lines) | stat: -rw-r--r-- 2,475 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
# aewm - Copyright 1998-2007 Decklin Foster <decklin@red-bean.com>.
# This program is free software; see LICENSE for details.

# Set this to the location where you want to install
DESTDIR =
XROOT = /usr

# Uncomment to enable Shape extension support
OPT_WMFLAGS += -DSHAPE
OPT_WMLIB += -lXext

# Uncomment to add Xft support
OPT_WMFLAGS += -DXFT `pkg-config --cflags xft`
OPT_WMLIB += `pkg-config --libs xft` -lXext

# Uncomment for debugging (abandon all hope, ye who enter here)
#OPT_WMFLAGS += -DDEBUG
#OPT_WMLIB += -lefence

CC = gcc
# CFLAGS = -g -O2 -Wall

BINDIR = $(DESTDIR)$(XROOT)/bin
MANDIR = $(DESTDIR)$(XROOT)/share/man/man1
CFGDIR = $(DESTDIR)/etc/X11/aewm

PLAINOBJ = aesession.o parser.o
CLIENTOBJ = common.o atom.o
X11OBJ = $(CLIENTOBJ) aedesk.o menu.o
WMOBJ = aewm_client.o aewm_event.o aewm_init.o aewm_manip.o
GTKOBJ = aemenu.o aepanel.o
ALLOBJ = $(PLAINOBJ) $(X11OBJ) $(WMOBJ) $(GTKOBJ)

PLAINBIN = aesession
X11BIN = aedesk
WMBIN = aewm
GTKBIN = aemenu aepanel
ALLBIN = $(PLAINBIN) $(X11BIN) $(WMBIN) $(GTKBIN)

all: $(ALLBIN)
aesession:
aedesk: $(CLIENTOBJ)
aewm: $(CLIENTOBJ) $(WMOBJ) parser.o
aemenu: $(CLIENTOBJ) menu.o parser.o
aepanel: $(CLIENTOBJ) menu.o parser.o

X11FLAGS = -I$(XROOT)/include
WMFLAGS = $(X11FLAGS) $(OPT_WMFLAGS)
GTKFLAGS = `pkg-config --cflags gtk+-2.0`

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

$(X11OBJ): %.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(X11FLAGS) -c $< -o $@

$(WMOBJ): %.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(WMFLAGS) -c $< -o $@

$(GTKOBJ): %.o: %.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(GTKFLAGS) -c $< -o $@

X11LIB = -L$(XROOT)/lib -lX11
WMLIB = $(X11LIB) $(OPT_WMLIB)
GTKLIB = `pkg-config --libs gtk+-2.0` -lX11

$(PLAINBIN): %: %.o
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ -o $@

$(X11BIN): %: %.o
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(X11LIB) -o $@

$(WMBIN): %:
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(WMLIB) -o $@

$(GTKBIN): %: %.o
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $^ $(GTKLIB) -o $@

AEMAN = aewm.1x aeclients.1x
AERC = aewmrc clientsrc

install: all
	mkdir -p $(BINDIR) $(MANDIR) $(CFGDIR)
	install $(ALLBIN) $(BINDIR)
	for i in $(AEMAN); do \
	    install -m 644 doc/$$i $(MANDIR); \
	    gzip -9 $(MANDIR)/$$i; \
	done
	for i in $(AERC); do \
	    install -m 644 doc/$$i.ex $(CFGDIR)/$$i; \
	done
	for i in $(PLAINBIN) $(X11BIN) $(GTKBIN); do \
	    ln -sf aeclients.1x.gz $(MANDIR)/$$i.1x.gz; \
	done

clean:
	rm -f $(ALLBIN) $(ALLOBJ)

.PHONY: all install clean