]>
Commit | Line | Data |
---|---|---|
1 | # common variables ... | |
2 | ######################################################################## | |
3 | ||
4 | # directories | |
5 | DESTDIR = | |
6 | srcdir ?= . | |
7 | prefix ?= /usr/local | |
8 | bindir = $(DESTDIR)$(prefix)/bin | |
9 | libdir = $(DESTDIR)$(prefix)/$(LIB) | |
10 | shrdir = $(DESTDIR)$(prefix)/share | |
11 | mandir = $(shrdir)/man | |
12 | locdir = $(shrdir)/locale | |
13 | appdir = $(shrdir)/applications | |
14 | ||
15 | # package + version | |
16 | empty := | |
17 | space := $(empty) $(empty) | |
18 | ifneq ($(wildcard $(srcdir)/VERSION),) | |
19 | VERSION := $(shell cat $(srcdir)/VERSION) | |
20 | else | |
21 | VERSION := 42 | |
22 | endif | |
23 | RELTAG := v$(subst .,_,$(VERSION)) | |
24 | ||
25 | # programs | |
26 | CC ?= gcc | |
27 | CXX ?= g++ | |
28 | MOC ?= $(if $(QTDIR),$(QTDIR)/bin/moc,moc) | |
29 | ||
30 | STRIP ?= -s | |
31 | INSTALL ?= install | |
32 | INSTALL_BINARY := $(INSTALL) $(STRIP) | |
33 | INSTALL_SCRIPT := $(INSTALL) | |
34 | INSTALL_DATA := $(INSTALL) -m 644 | |
35 | INSTALL_DIR := $(INSTALL) -d | |
36 | ||
37 | # cflags | |
38 | CFLAGS ?= -g -O2 | |
39 | CXXFLAGS ?= $(CFLAGS) | |
40 | CFLAGS += -Wall -Wmissing-prototypes -Wstrict-prototypes \ | |
41 | -Wpointer-arith -Wunused | |
42 | CXXFLAGS += -Wall -Wpointer-arith -Wunused | |
43 | ||
44 | # add /usr/local to the search path if something is in there ... | |
45 | ifneq ($(wildcard /usr/local/include/*.h),) | |
46 | CFLAGS += -I/usr/local/include | |
47 | LDFLAGS += -L/usr/local/$(LIB) | |
48 | endif | |
49 | ||
50 | # fixup include path for $(srcdir) != "." | |
51 | ifneq ($(srcdir),.) | |
52 | CFLAGS += -I. -I$(srcdir) | |
53 | endif | |
54 |