File: Makefile

package info (click to toggle)
im-config 0.43-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 736 kB
  • sloc: sh: 309; makefile: 64
file content (83 lines) | stat: -rw-r--r-- 1,821 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
PROGRAM	=	im-config
ifeq ($(wildcard debian/changelog),)
VERSION = VCS-$(shell date -u  +%Y%m%d%H%M)
else
VERSION = $(shell dpkg-parsechangelog --format dpkg|\
		sed -ne '/^Version/s/Version: *//p')
endif

FILES = \
	70-im-config \
	70im-config_launch \
	im-config \
	im-launch \
	share/im-config.common \
	share/xinputrc.common.in \
	$(wildcard data/*.rc) \
	$(wildcard data/*.conf)

PRETESTS = $(addsuffix .pretest, $(FILES))

TESTS = $(addsuffix .test, $(FILES))

# escape  with \#
LANGS = $(shell grep -v '^\#' po/LINGUAS)
POTFILESIN = $(shell grep -v '^\#' po/POTFILES.in)

all: share/xinputrc.common mo

share/xinputrc.common: share/xinputrc.common.in
	sed -e "s/@@VERSION@@/$(VERSION)/" <$< >$@

pot: po/$(PROGRAM).pot

po/$(PROGRAM).pot: FORCE
	xgettext -o $@ --language=Shell $(PROGRAM) $(POTFILESIN)

po/%.po: po/$(PROGRAM).pot
	msgmerge -U $@ $<

po/locale/%/LC_MESSAGES/$(PROGRAM).mo: po/%.po
	mkdir -p po/locale/$*/LC_MESSAGES
	msgfmt -o $@ $<

# run test on all script first
%.pretest: %
	@/bin/sh -n $< ; echo $$? > $@

# stop if error was found
%.test: %.pretest
	@[ `cat $<` = "0" ]

test: $(PRETESTS)
	# check if any syntax check resulted in error
	@$(MAKE) $(TESTS)

mo:	$(addsuffix /LC_MESSAGES/$(PROGRAM).mo, $(addprefix po/locale/, $(LANGS)))

po:	$(addsuffix .po, $(addprefix po/, $(LANGS)))

foo:
	echo "$(addsuffix /LC_MESSAGES/$(PROGRAM).mo, $(addprefix po/locale/, $(LANGS)))"
	echo "-----"
	echo "$(addsuffix .po, $(addprefix po/, $(LANGS)))"

clean:
	-rm -f share/xinputrc.common
	rm -rf po/locale
	rm -f  po/*.po~ po/*.mo
	-rm -f $(PRETESTS)
	-rm -f $(TESTS)

distclean: clean

# Use this target on devel branch source
package:
	debmake -t -y -zx -b':sh' -i pdebuild

update:
	touch -t 200001010000 po/*.po
	$(MAKE) po
	$(MAKE) clean

.PHONY: all pot distclean clean mo update po test FORCE