Debian Codegraph @

Makefile

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 #
2 # This file is part of devilspie2
3 # Copyright (C) 2011-2015 Andreas Rönnquist
4 #
5 # devilspie2 is free software: you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as published
7 # by the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # devilspie2 is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with devilspie2.
17 # If not, see <http://www.gnu.org/licenses/>.
18 #
19
20 ifndef CC
21 CC=gcc
22 endif
•23 ifndef PKG_CONFIG
24 PKG_CONFIG=pkg-config
25 endif
26 SRC=src
27 OBJ=obj
28 BIN=bin
29
30 ifdef DEBUG
31 STD_CFLAGS=-Wall -g3 -ggdb -D_DEBUG
32 else
33 STD_CFLAGS=-Wall -Wformat -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -Wformat=2
34 endif
35
36 DEPEND=Makefile.dep
37
38 OBJECTS=$(OBJ)/config.o $(OBJ)/devilspie2.o $(OBJ)/xutils.o $(OBJ)/script.o $(OBJ)/script_functions.o $(OBJ)/error_strings.o
39
40 ifndef PREFIX
41 ifdef INSTALL_PREFIX
42 PREFIX=$(INSTALL_PREFIX)
43 else
44 PREFIX=/usr/local
45 endif
46 endif
47
48 NAME = devilspie2
49 PROG=$(BIN)/$(NAME)
50 VERSION = $(shell cat ./VERSION)
51 DATADIR = ${DESTDIR}${PREFIX}/share
52 LOCALEDIR = ${DATADIR}/locale
53 MANPAGE = ${NAME}.1
54
55 ifdef GTK2
56 PKG_GTK=gtk+-2.0
57 PKG_WNCK=libwnck-1.0
58
59 CHECK_GTK3=1
60 else
61 PKG_GTK=gtk+-3.0
62 PKG_WNCK=libwnck-3.0
63 endif
64
•65 LIB_CFLAGS=$(shell $(PKG_CONFIG) --cflags --silence-errors $(PKG_GTK) $(PKG_WNCK) lua5.1 || $(PKG_CONFIG) --cflags $(PKG_GTK) $(PKG_WNCK) lua)
66 STD_LDFLAGS=
•67 LIBS=-lX11 $(shell $(PKG_CONFIG) --libs --silence-errors $(PKG_GTK) $(PKG_WNCK) lua5.1 || $(PKG_CONFIG) --libs $(PKG_GTK) $(PKG_WNCK) lua)
68
69 LOCAL_CFLAGS=$(STD_CFLAGS) $(DEPRECATED) $(CFLAGS) $(LIB_CFLAGS)
70 LOCAL_LDFLAGS=$(STD_CFLAGS) $(LDFLAGS) $(STD_LDFLAGS)
71
72 LOCAL_CPPFLAGS=$(CPPFLAGS)
73
74 ifdef CHECK_GTK3
75 LOCAL_CFLAGS+=-DGTK_DISABLE_SINGLE_INCLUDES
76 LOCAL_CFLAGS+=-DGSEAL_ENABLE
77
78 CHECK_DEPRECATED=1
79 endif
80
81 ifdef CHECK_DEPRECATED
82 LOCAL_CFLAGS+=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
83 endif
84
85 LOCAL_CFLAGS+=-DLOCALEDIR=\"$(LOCALEDIR)\" -DPACKAGE=\"$(NAME)\" -DDEVILSPIE2_VERSION=\"$(VERSION)\"
86
87 .PHONY: all
88 all: $(BIN)/devilspie2
89 ${MAKE} -C po -j1 all
90
91 $(OBJ)/%.o: $(SRC)/%.c
92 $(CC) $(LOCAL_CFLAGS) $(LOCAL_CPPFLAGS) -c $< -o $@
93
94 $(BIN)/$(NAME): $(OBJECTS)
95 $(CC) $(LOCAL_CFLAGS) $(LOCAL_LDFLAGS) $(OBJECTS) -o $(PROG) $(LIBS)
96
97 .PHONY: clean
98 clean:
99 rm -rf $(OBJECTS) $(PROG) $(DEPEND)
100 ${MAKE} -C po clean
101
102 install:
103 install -d $(DESTDIR)$(PREFIX)/bin
104 install -m 755 $(PROG) $(DESTDIR)$(PREFIX)/bin
105 install -d $(DESTDIR)$(PREFIX)/share/man/man1
106 install -m 644 $(MANPAGE) $(DESTDIR)$(PREFIX)/share/man/man1
107 ${MAKE} -C po install
108
109 .PHONY: uninstall
110 uninstall:
111 rm -f $(DESTDIR)$(PREFIX)/$(PROG)
112 ${MAKE} -C po uninstall
113
114 $(DEPEND):
115 $(CC) -MM $(LOCAL_CFLAGS) $(SRC)/*.c | sed -e "s/\([A-Za-z0-9+-0._&+-]*:\)/\$(OBJ)\/\1/g" > $(DEPEND)
116
117 -include $(DEPEND)