File: Makefile

package info (click to toggle)
chdrv 1.0.13-0.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,204 kB
  • ctags: 1,069
  • sloc: ansic: 8,972; perl: 412; asm: 234; makefile: 195; sh: 36
file content (195 lines) | stat: -rw-r--r-- 5,808 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
194
195
# An easy installation guide
#  (1) Edit CHBIN, CHSYS, CHFONT to adapt to your site
#  (2) Make unpack
#  (3) cd ${CHSRC}
#  (4) make all
#  (5) make install
#
# Install Parameter
#     The below location is adapted to the Debian distribution.
#     You can remove the flag -DDEBUG of ${OPT} but I recommend
#     reserve it because CHDRV is a BETA production.

DESTDIR =
prefix = ${DESTDIR}/usr/local

CHBIN = ${prefix}/bin
CHSRC = /root/chinese
CHSYS= ${prefix}/lib/chinese
OPT1 = -O2 -DDISABLE_CACHE -DDISABLE_FUNCTION_KEY#-DSLOW_CHECK
#OPT1 = -lg -g -DDEBUG -DREMOTE_DEBUGGER -DDISABLE_FUNCTION_KEY 

OPT = ${OPT1} -DUSE_ELF
VERSION=1.0.13

# If you want to include svgalib driver, you must uncomment the below line
#GLIB = -lvga -lvgagl -lvga
GLIB = -lvga -lvgagl

#
#


OBJ1 = chinese.o vga.o drawtext.o output.o input.o error.o \
       ptyopen.o  scroll.o HBF_api.o loadfont.o portable.o \
	phone.o fontcache.o chdrv.o svga-driver.o macrokey.o \
	graphics.o version.o

#OBJ2 = cnprint220.o
FONT = ${prefix}/chinese/kcchin16.f00 ${prefix}/chinese/kctext16.f00
SFLAGS = ${OPT} #-DVGA_16BIT
CFLAGS = -DCHSYS=\"${CHSYS}/\" -DCHBIN=\"${CHBIN}/\" #-DDEBUG_LOG_INPUT
.c.o:
	gcc -c ${CFLAGS} -DUSE_BY_CHDAM ${OPT} $*.c

.S.o:
	gcc -c ${SFLAGS} -o $*.o $*.S

.s.o:
	gcc -c -o $*.o $*.s

all : test_unpack ${OBJ1} mkmulti chdrv NCTU-CSIE-CJ.tbl array30.tbl \
	testspeed \
	mkai
#	cnprint mkai

.PHONY: all test_unpack clean install uninstall test pack unpack

test_unpack :
	# ./check_if_unpack	

NCTU-CSIE-CJ.tbl : NCTU-CSIE-CJ.def
	./mkmulti NCTU-CSIE-CJ.def NCTU-CSIE-CJ.tbl

array30.tbl : array30.def
	./mkmulti array30.def array30.tbl

#chinese.o : chinese.c
#	gcc -DDEBUG  -c -o chinese.o chinese.c

mkai : mkai.c
	gcc -o mkai mkai.c 
	
testspeed : testspeed.o
	gcc -O2 -o testspeed testspeed.o


clean :
	rm -f *.o *.a mkai mkmulti chdrv testspeed \
		NCTU-CSIE-CJ.tbl array30.tbl

mkmulti : mkmulti.o
	gcc -o mkmulti mkmulti.o

chdrv : ${OBJ1} 
	gcc -O2 -Wall -o chdrv ${OBJ1} ${GLIB} 

displayfont : displayfont.c
	gcc -o displayfont displayfont.c vga.o scroll.o drawtext.o

install: all
	# rm -f /usr/bin/ttyserver
	# rm -f /usr/bin/chdam
	# rm -f /usr/bin/ccc
	# rm -f /usr/bin/mkmulti
	# rm -f ${CHBIN}/ccc
	# rm -f ${CHBIN}/chdam
	# rm -f ${CHBIN}/ttyserver
	install -d ${CHSYS}
	install -d ${CHBIN}
	install -m 4755 chdrv ${CHBIN}
	install -m 644 hanfont ${CHSYS}
	install -m 644 multitab ${DESTDIR}/etc
	install -m 644 phone.def ${CHSYS}
	install -m 644 kcfont ${CHSYS}
	install -m 644 termcap ${DESTDIR}/etc/termcapG
	install -m 644 hbffont ${CHSYS}
	install -m 644 gbfont ${CHSYS}
	install -m 644 cclib16.hbf ${CHSYS}
	install -m 644 cclib.16 ${CHSYS}
	install -m 644 cclib.16a ${CHSYS}
#### Commented for Debian (read README.Debian for details)
##	install -m 755 chconfig ${CHBIN}
	install -m 644 NCTU-CSIE-CJ.tbl ${CHSYS}
	install -m 644 array30.tbl ${CHSYS}
	install -m 644 keys.tw ${CHSYS}
#	install -m 644 chdrv.mac ${CHSYS}
	install -m 644 chdrv.mac ${DESTDIR}/etc
	echo "#!/bin/sh" > ${CHBIN}/etmode
	echo "loadkeys ${CHSYS:${DESTDIR}%=%}/keys.tw" >> ${CHBIN}/etmode
	chmod 755 ${CHBIN}/etmode
# the below line should be uncommented when endup BETA testing
#	rm -f /dev/cin
	@echo "If shell tell you can't find chconfig, you must edit the first "
	@echo "line of ./chconfig to fit your file system."
	./chconfig -c ${DESTDIR}/etc/chinese.conf -m ${DESTDIR}/etc/multitab \
		${CHSYS}/
	chmod 755 ${CHSYS}/ch_profile
	
uninstall :
	rm -f ${CHSYS}/hanfont
	rm -f ${CHBIN}/ttyserver
	rm -f ${CHBIN}/chdrv		
	rm -f ${DESTDIR}/etc/multitab
	rm -f ${DESTDIR}/etc/termcapG
	rm -f ${CHSYS}/kcfont
	rm -f ${CHSYS}/phone.def
	rm -f ${CHSYS}/hbffont
	rm -f ${DESTDIR}/etc/sethbffont
	rm -f ${CHBIN}/chconfig
test:
	tail -1 version.c | sed -e "s/.*\"\([^-]*\)-.*/chdrv-\1\.tar/"
	echo ${TMP}

pack :
	#cp has_unpack not_unpack
	mkdir /tmp/chdrv-${VERSION}
	cp chinese.c vga.c chinese.h vga.h drawtext.S \
	        termcap Makefile \
		hanfont input.c output.c main.c ttyserver.c \
		ptyopen.c mkmulti.c vgadef.h chmsg.h error.c ccc.c scroll.S \
		TODO fullsize.h PROBLEM testspeed.c color.h \
		phone.def phone.c \
		phone.h version.c multitab kcfont displayfont.c \
		hbffont loadfont.c HBF-SUPPORT \
		MANUAL.DOC HBF_api.c HBF_api.h \
		chexist.c \
		NEWS chdrv.FAQ portable.c portable.h PORTABLE.DOC tit2def.perl\
		tit2phone.perl chconfig chinese.conf installsrc \
		check_if_unpack INSTALL.1.0 input.h mkai.c \
		fontcache.c font.h chdrv.c svga-driver.c keys.tw array30.def \
		NCTU-CSIE-CJ.def README macrokey.c chdrv.mac demo.pl graphics.c\
                gbfont cclib16.hbf cclib.16 cclib.16a\
		ANNOUNCE 80x24mode 80x29mode /tmp/chdrv-${VERSION}
	(cd /tmp;tar czvf chdrv-${VERSION}.tar.gz chdrv-${VERSION})
	mv /tmp/chdrv-${VERSION}.tar.gz .
	rm -rf /tmp/chdrv-${VERSION}	

	mkdir /tmp/chdrv-${VERSION}
	#rm not_unpack
	cp chdrv \
		mkmulti \
		chinese.conf chconfig \
		phone.def hanfont hbffont kcfont \
		termcap MANUAL.DOC chdrv.FAQ NEWS \
		HBF-SUPPORT INSTALL.1.0 keys.tw NCTU-CSIE-CJ.tbl etmode README\
		chdrv.mac NCTU-CSIE-CJ.def array30.def installbin \
                gbfont cclib16.hbf cclib.16 cclib.16a\
		ANNOUNCE 80x24mode 80x29mode chdrvfont.tar.gz /tmp/chdrv-${VERSION}
	(cd /tmp;tar czvf chdrvbin-${VERSION}.tar.gz chdrv-${VERSION})
	mv /tmp/chdrvbin-${VERSION}.tar.gz .
	rm -rf /tmp/chdrv-${VERSION}	

unpack: 
	./installsrc

	@echo Font Install complete
	@echo Copy src to ${CHSRC}
	install -d ${CHSRC}
	cp * ${CHSRC}
	(cd ${CHSRC};mv not_unpack has_unpack)
	@echo Install source complete.  Please change directory to ${INSTSRC} 
	@echo and type 'make install' to complete the Installation.
	@echo If you encounter any errors during installation, please report to
	@echo twchiu2@phys.ntu.edu.tw.  Thanks.
#	@echo Note: You may delete all the files in this directory.