-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
47 lines (39 loc) · 1.24 KB
/
Makefile
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
PROGRAM = dsbmc
PREFIX ?= /usr/local
BINDIR = ${PREFIX}/bin
LOCALEDIR = ${PREFIX}/share/locale
GTKVER ?= 2.0
CFLAGS += -Wall `pkg-config gtk+-${GTKVER} --cflags --libs`
CFLAGS += -Wno-deprecated-declarations
CFLAGS += -DPROGRAM=\"${PROGRAM}\" -DPATH_LOCALE=\"${LOCALEDIR}\"
TARGETS = ${PROGRAM}
SOURCES = ${PROGRAM}.c gtk-helper/gtk-helper.c dsbcfg/dsbcfg.c
NLS_LANGS = de
NLS_SOURCES = ${NLS_TARGETS:R:S,$,.po,}
NLS_TARGETS = ${NLS_LANGS:S,^,locale/,:S,$,.mo,}
BSD_INSTALL_DATA ?= install -m 0644
BSD_INSTALL_PROGRAM ?= install -s -m 555
.if !defined(WITHOUT_GETTEXT)
CFLAGS += -DWITH_GETTEXT
TARGETS += ${NLS_TARGETS}
.endif
all: ${TARGETS}
${PROGRAM}: ${SOURCES}
${CC} -o ${PROGRAM} ${CFLAGS} ${SOURCES}
${NLS_TARGETS}: ${NLS_SOURCES}
for i in locale/*.po; do \
msgfmt -c -v -o $${i%po}mo $$i; \
done
install: ${TARGETS}
${BSD_INSTALL_PROGRAM} ${PROGRAM} ${DESTDIR}${BINDIR}
${BSD_INSTALL_DATA} ${PROGRAM}.desktop \
${DESTDIR}${PREFIX}/share/applications
.if !defined(WITHOUT_GETTEXT)
(cd locale && for i in *.mo; do \
${BSD_INSTALL_DATA} $$i \
${DESTDIR}${LOCALEDIR}/$${i%.mo}/LC_MESSAGES/${PROGRAM}.mo; \
done)
.endif
clean:
-rm -f ${PROGRAM}
-rm -f locale/*.mo