File: Makefile

package info (click to toggle)
libjconv 2.8-7
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 160 kB
  • ctags: 51
  • sloc: ansic: 567; makefile: 149
file content (61 lines) | stat: -rw-r--r-- 1,778 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

CC = gcc
OBJS = conv.o info.o compat.o
SRCS = $(OBJS:.o=.c)
CFLAGS ?= -Wall -g -O2
CFLAGS += -fPIC -DHAVE_CODESET
PKGDIR = libjconv-2.8
MAJOR = 2

all: jconv libjconv.so libjconv.a default.conf

jconv: jconv.o libjconv.so
	$(CC) $(CFLAGS) $(LDFLAGS) -o jconv jconv.o -L. -ljconv

libjconv.so: $(OBJS)
	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,libjconv.so.$(MAJOR) -o libjconv.so $(OBJS)

libjconv.a: $(OBJS)
	ar rc libjconv.a $(OBJS)

clean:
	rm -rf $(OBJS) jconv.o *~ jconv $(PKGDIR) $(PKGDIR).tar.gz
	rm -f tmp.conf
	rm -f libjconv.so libjconv.a

dist: clean
	mkdir $(PKGDIR)
	cp *.c *.h Makefile *.spec COPYING README *.conf $(PKGDIR)
	tar cvfz $(PKGDIR).tar.gz $(PKGDIR)

default.conf:
	( cd /usr/share/i18n/locales/; \
	for i in ??_??; do grep "^% Charset" $$i /dev/null; done \
	| sed -e "s/% Charset//g" | sed -e "s/:[0-9]*$$//g" \
	| grep -v "^ko_KR" \
	| grep -v "^zh_CN" \
	| sed -e "s/:: \+/   : /g" \
	| sed -e "s/ISO_/ISO-/g" \
	) >> tmp.conf
	echo "# name  : codeset    [ file-codesets ... ]" > default.conf
	cat tmp.conf >> default.conf
	echo "ja_JP   : EUC-JP ISO-2022-JP ISO-2022-JP-2 EUC-JP SJIS" \
		>> default.conf
	echo "ko_KR   : EUC-KR ISO-2022-KR EUC-KR" \
		>> default.conf
	echo "zh_CN   : EUC-CN ISO-2022-CN EUC-CN GB2312" \
		>> default.conf
	echo "zh_TW   : EUC-TW ISO-2022-CN EUC-TW BIG5" \
		>> default.conf
	sed -e \
	"s/\\(.._..\\) \+: \+\\([^ ]\+\\)$$/\\1.UTF-8 : UTF-8 \\2 UTF-8/" \
		< tmp.conf >> default.conf
	echo "ja_JP.UTF-8 : UTF-8 ISO-2022-JP ISO-2022-JP-2 EUC-JP SJIS UTF-8" \
		>> default.conf
	echo "ko_KR.UTF-8 : UTF-8 ISO-2022-KR EUC-KR UTF-8" \
		>> default.conf
	echo "zh_CN.UTF-8 : UTF-8 ISO-2022-CN EUC-CN GB2312 UTF-8" \
		>> default.conf
	echo "zh_TW.UTF-8 : UTF-8 ISO-2022-CN EUC-TW BIG5 UTF-8" \
		>> default.conf