summaryrefslogtreecommitdiff
path: root/converters/cn2jp/patches/patch-aa
blob: 2381db352baba80f04565e65692f67f9421d8e25 (plain)
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
84
85
$NetBSD: patch-aa,v 1.1.1.1 2002/03/30 06:03:39 uebayasi Exp $

--- Makefile.orig	Tue Feb 27 22:35:44 1996
+++ Makefile
@@ -1,7 +1,5 @@
-INCLUDE=
 
-CC=cc
-CFLAGS= -g -I../lib -I. -L../lib -L.
+CFLAGS+= -I./lib
 
 SRC = README Makefile */*.c */*.h */*.tbl */Makefile */README
 OBJS = big2jis/b2j-util.o big2jis/b2j_table.o \
@@ -12,37 +10,43 @@
 	jis2gb/j2g-util.o jis2gb/j2g_table.o \
 	lib/lang-util.o lib/cn-util.o \
 	lib/py-tbl.o lib/uzpj-tbl.o lib/uzpj-util.o \
-	hz2gb.o gb2hz.o SINO.o jp-util2.o
+	lib/hz2gb.o lib/gb2hz.o lib/SINO.o lib/jp-util.o
 
-all: makeall libcn2jp.a
+PROG = big2jis/b2j jis2big/j2b \
+	big2gb/b2g gb2big/g2b \
+	gb2jis/g2j jis2gb/j2g
+
+LIB = libcn2jp.a
+
+install:
+	$(LIBTOOL) --mode=install $(BSD_INSTALL_DATA) $(LIB:.a=.la) $(PREFIX)/lib
+	for i in $(PROG);do \
+		$(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) $$i $(PREFIX)/bin; \
+	done
+
+all: clean mktable $(LIB) makeall
+
+mktable:
+	cd table;make
+	ln -s table/mktable mktable
+	ln -s table/mktbl2c mktbl2c
+	cd big2jis;../mktable big2jis.tbl;../mktbl2c big2jis.t b2j > b2j_table.c
+	cd jis2big;../mktable jis2big.tbl;../mktbl2c jis2big.t j2b > j2b_table.c
+	cd big2gb;../mktable big2gb.tbl;../mktbl2c big2gb.t b2g > b2g_table.c
+	cd gb2big;../mktable gb2big.tbl;../mktbl2c gb2big.t g2b > g2b_table.c
+	cd gb2jis;../mktable gb2jis.tbl;../mktbl2c gb2jis.t g2j > g2j_table.c
+	cd jis2gb;../mktable jis2gb.tbl;../mktbl2c jis2gb.t j2g > j2g_table.c
+
+makeall: big2jis/b2j.o jis2big/j2b.o big2gb/b2g.o gb2big/g2b.o gb2jis/g2j.o jis2gb/j2g.o
+	for i in $(PROG);do \
+		$(LIBTOOL) --mode=link $(CC) -o $$i $$i.lo $(LIB:.a=.la); \
+	done
 
+$(LIB): $(OBJS)
+	$(LIBTOOL) --mode=link $(CC) -o $(LIB:.a=.la) $(OBJS:.o=.lo) -rpath $(PREFIX)/lib
 
-makeall:
-	cd lib; make; cd ..
-	cd big2jis; make; cd ..
-	cd jis2big; make; cd ..
-	cd big2gb; make; cd ..
-	cd gb2big; make; cd ..
-	cd gb2jis; make; cd ..
-	cd jis2gb; make; cd ..
-
-libcn2jp.a:  $(OBJS)
-	rm -f libcn2jp.a
-	ar r libcn2jp.a $(OBJS)
-	ranlib libcn2jp.a
-	cp libcn2jp.a ../../../lib/libcn2jp.a
-
-gb2hz.o: lib/gb2hz.c
-	$(CC) -c lib/gb2hz.c
-
-hz2gb.o: lib/hz2gb.c
-	$(CC) -c lib/hz2gb.c
-
-SINO.o: lib/SINO.c
-	$(CC) -c lib/SINO.c
-
-jp-util2.o: lib/jp-util2.c
-	$(CC) -c lib/jp-util2.c
+%.o: %.c
+	$(LIBTOOL) --mode=compile $(CC) $(CFLAGS) -c -o $@ $<
 
 tar:
 	echo "Produce cn2jp`date '+%m%d'`.tar..."