File: Makefile

package info (click to toggle)
libmoe 1.5.7-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny, sarge
  • size: 6,772 kB
  • ctags: 267,602
  • sloc: ansic: 478,515; perl: 2,318; makefile: 201; sh: 22
file content (193 lines) | stat: -rw-r--r-- 5,189 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# You need GNU C, GNU Make, GNU fileutils, and GNU binutils.

include version.mak

DESTDIR=
PREFIX=/usr/local
INCDIR=${PREFIX}/include/moe
LIBSODIR=${PREFIX}/lib
LIBADIR=${LIBSODIR}
LIBEXECDIR=${PREFIX}/libexec/moe
BINDIR=${PREFIX}/bin
MANDIR=${PREFIX}/man
MANSECT=1
MANCOMPR=gzip -9c
MANX=.gz

UNICODE_DOC_DIR=${HOME}/doc/unicode
RFC_DIR=${HOME}/doc/rfc

DEST=libmoe
Os=altmalloc.o btri.o uirx.o wcrx.o mbces.o iso2mb.o mb2iso.o mbinit.o mbfind.o mbio.o jis0208-extra.o
Hs=mbversion.h mbcesdefs.h mbcesconf.h mblangconf.h altmalloc.h btri.h uirx.h wcrx.h mbces.h mb.h

BTRI_Hs=\
notascii.h \
mbwcweight.h \
jis1flag.h \
jis0208-to-ucs-extra.h \
ucs-to-jis0208-extra.h \
full-to-half.h \
half-to-full.h \
iso-to-ucs.h \
ucs-to-iso.h \
xterm_ucswidth.h \
eaw_a2n_ucswidth.h \
eaw_a2w_ucswidth.h \
mbtermtab.h \
prop.h \
mbcestab.h \
mbconvtab.h \
mbflagtab.h \
mbdetectortab.h

BTRI_Cs=

ALL=${DEST}.so
INST=${Hs}
INSTLIBA=${DEST}.a
INSTLIBSO=${DEST}.so ${DEST}.so.${VER}.${RELEASE} ${DEST}.so.${VER}.${RELEASE}.${LEVEL}
INSTLIBEXEC=mk_btri${EXT}
INSTBIN=mbconv${EXT}

DEBUG=
CF=${DEBUG} -O2 -Wall -fpic -I.
LF=-shared -Wl,-soname,${DEST}.so.${VER}.${RELEASE}
CC=gcc
CPP=gcc -E
LD=gcc
RANLIB=ranlib
AR=ar

#  Hideyuki SHIRAI <shirai@rdmg.mgcs.mei.co.jp> informed me that
#  Solaris7 requires definitions:
#LF=-dy -G -I  ${DEST}.so.${VER}.${RELEASE}
#LD=ld

#  Tsutomu OKADA <tsutomu.okada@furuno.co.jp> informed me that
#  Cygwin requires command extension:
#EXT=.exe

all: ${INSTLIBA} mbconv mbconv.man

mbconv: mbconv.c ${ALL}
	${CC} ${CF} -o $@ $< -L. -lmoe


${DEST}.so: ${DEST}.so.${VER}.${RELEASE}
	ln -sf $< $@

${DEST}.so.${VER}.${RELEASE}: ${DEST}.so.${VER}.${RELEASE}.${LEVEL}
	ln -sf $< $@

${DEST}.so.${VER}.${RELEASE}.${LEVEL}: ${Os}
	${LD} ${LF} -o $@ $^

${DEST}.a: ${Os}
	${AR} cru $@ $^
	${RANLIB} $@

%.o: %.c
	${CC} ${CF} -c $<

altmalloc.o: altmalloc.c altmalloc.h
btri.o: btri.c btri.h altmalloc.h
uirx.o: uirx.c uirx.h altmalloc.h
wcrx.o: wcrx.c wcrx.h altmalloc.h uirx.h
iso2mb.o: iso2mb.c ${Hs} notascii.h mbwcweight.h
mb2iso.o: mb2iso.c ${Hs} jis1flag.h domestic-ascii.h full-to-half.h half-to-full.h iso-to-ucs.h ucs-to-iso.h ucs-to-iso-pool.h
mbfind.o: mbfind.c ${Hs} xterm_ucswidth.h eaw_a2n_ucswidth.h eaw_a2w_ucswidth.h mbtermtab.h prop.h
mbio.o: mbio.c ${Hs}
jis0208-extra.o: jis0208-extra.c ${Hs} jis0208-to-ucs-extra.h ucs-to-jis0208-extra.h
mbinit.o: mbinit.c ${Hs} mbcestab.h mbconvtab.h mbflagtab.h mbdetectortab.h
mbces.o: mbces.c ${Hs}

mbversion.h: version.mak
	echo "#define MB_VERSION_STRING \"${VER}.${RELEASE}.${LEVEL}${EXTRA}\"" >$@
	echo "#define MB_VERSION (${VER}*10000+${RELEASE}*100+${LEVEL})" >>$@

${BTRI_Hs}: %.h: %.mk_btri.h mk_btri
	-rm -f $@
	${CPP} ${CF} $< | ./mk_btri >$@-new && mv $@-new $@

${BTRI_Cs}: %.c: %.mk_btri.c mk_btri
	-rm -f $@
	./mk_btri <$< >$@-new && mv $@-new $@

mk_btri: btri.c btri.h altmalloc.o
	${CC} ${CF} -DMAIN -o $@ $< altmalloc.o

mbconv.man: mbconv.pod
	pod2man --section=${MANSECT} --center=' ' $< >$@

install: install-bin install-lib install-man

install-bin: mbconv mk_btri
	test "X${INSTLIBSO}" \!= X && { \
		rm -f \
		${DESTDIR}${LIBSODIR}/${DEST}.so \
		${DESTDIR}${LIBSODIR}/${DEST}.so.${VER}.${RELEASE} \
		${DESTDIR}${LIBSODIR}/${DEST}.so.${VER}.${RELEASE}.* ; \
		mkdir -p ${DESTDIR}${LIBSODIR} ; \
		test -d ${DESTDIR}${LIBSODIR} && cp -pd ${INSTLIBSO} ${DESTDIR}${LIBSODIR} ; \
	}
	test "X${INSTBIN}" \!= X && { \
		mkdir -p ${DESTDIR}${BINDIR} ; \
		test -d ${DESTDIR}${BINDIR} && cp -pd ${INSTBIN} ${DESTDIR}${BINDIR} ; \
	}

install-lib: ${INSTLIBA}
	test "X${INST}" \!= X && { \
		mkdir -p ${DESTDIR}${INCDIR} ; \
		test -d ${DESTDIR}${INCDIR} && cp -pd ${INST} ${DESTDIR}${INCDIR} ; \
	}
	test "X${INSTLIBA}" \!= X && { \
		mkdir -p ${DESTDIR}${LIBADIR} ; \
		test -d ${DESTDIR}${LIBADIR} && cp -pd ${INSTLIBA} ${DESTDIR}${LIBADIR} ; \
	}
	test "X${INSTLIBEXEC}" \!= X && { \
		mkdir -p ${DESTDIR}${LIBEXECDIR} ; \
		test -d ${DESTDIR}${LIBEXECDIR} && cp -pd ${INSTLIBEXEC} ${DESTDIR}${LIBEXECDIR} ; \
	}

install-man: mbconv.man
	mkdir -p ${DESTDIR}${MANDIR}/man${MANSECT}
	test -d ${DESTDIR}${MANDIR}/man${MANSECT} && \
		${MANCOMPR} <mbconv.man >${DESTDIR}${MANDIR}/man${MANSECT}/mbconv.${MANSECT}${MANX}

clean:
	rm -f ${DEST}.a ${DEST}.so* *.o mk_btri mbconv ${BTRI_Hs}

clean-oldso:
	for f in ${DEST}.so.${VER}.${RELEASE}.*; do \
		test "X$$f" = "X${DEST}.so.${VER}.${RELEASE}.${LEVEL}" || rm -f $$f ; \
	done

mbenclib.ph: mb.h
	-rm -f $@
	sed -ne '/ BEGIN h2ph /,/ END h2ph /p' $^ | h2ph -use_eval=0 >$@-new && mv $@-new $@

ucs-to-iso: mbenclib.ph
	perl ucs-to-iso.pl ${UNICODE_DOC_DIR}/UnicodeData-Latest.txt ${UNICODE_DOC_DIR}/*.TXT ${UNICODE_DOC_DIR}/*.xml

mbwcweight: mbenclib.ph
	perl $@.pl

domestic-ascii: mbenclib.ph
	perl domestic-ascii.pl

eaw_ucswidth:
	perl eaw_ucswidth.pl ${UNICODE_DOC_DIR}/EastAsianWidth.txt

jis0208-extra:
	perl jis0208-extra.pl ${UNICODE_DOC_DIR}/JIS0208.TXT.extra

release: clean ucs-to-iso mbwcweight domestic-ascii eaw_ucswidth jis0208-extra

btri_hs: ${BTRI_Hs}

btri_cs: ${BTRI_Cs}

.PHONY: all install install-bin install-lib install-man clean clean-oldso \
ucs-to-iso mbwcweight domestic-ascii eaw_ucswidth release \
btri_hs btri_cs