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
|
$NetBSD: patch-aa,v 1.3 2012/04/30 04:01:08 dholland Exp $
- configure for pkgsrc
- destdir support
--- Makefile.orig 2002-03-20 05:59:19.000000000 +0000
+++ Makefile
@@ -6,11 +6,11 @@
# set INSTALLROOT to the installation base; it is used to set the
# other directory variables below
-INSTALLROOT = /usr/local
+INSTALLROOT = $(PREFIX)
#INSTALLROOT = /usr
# set LIBDIR to where you will keep the datafiles, fontspecs, and "hanwin.tcl"
-LIBDIR = $(INSTALLROOT)/lib/Hanzim
+LIBDIR = $(INSTALLROOT)/lib/hanzim
#LIBDIR = /usr/local/lib/Hanzim
# for debugging
#LIBDIR = ./Data
@@ -24,7 +24,7 @@ MANDIR = $(INSTALLROOT)/man
#MANDIR = /usr/local/man
# set DOCDIR to where you want the documentation files to reside
-DOCDIR = $(INSTALLROOT)/doc
+DOCDIR = $(INSTALLROOT)/share/doc/hanzim
#DOCDIR = $(INSTALLROOT)/share/doc
#DOCDIR = /usr/local/share/doc
#DOCDIR = /usr/share/doc
@@ -41,13 +41,13 @@ OS=UNIX
#OS=WINDOWS
# location of Tcl and Tk libraries
-LIBTCLDIR = -L /usr/lib
+#LIBTCLDIR = -L /usr/lib
# location of x library
-LIBXDIR = -L /usr/X11/lib
+#LIBXDIR = -L /usr/X11/lib
# you might need to change "libtcl" and "libtk" to "libtcl8.x" and "libtk8.x"
-LIBS = $(LIBXDIR) $(LIBTCLDIR) -ltk -ltcl -lX11 -lm -ldl
+LIBS = $(LIBXDIR) $(LIBTCLDIR) -ltk -ltcl -lX11 -lm ${PTHREAD_LIBS} ${PTHREAD_LDADD}
INSTALL = install
RM = rm -f
@@ -55,11 +55,11 @@ RM = rm -f
# End of configuration.
###############################################################################
-CC = cc
+#CC = cc
DEFINES = -D$(OS) -DLIBDIR=\"$(LIBDIR)\"
-CFLAGS = -O2 $(DEFINES)
+CFLAGS += $(DEFINES)
#CFLAGS = -O2 -Wall -pedantic -ansi $(DEFINES)
-LFLAGS = $(LIBS) -s
+LFLAGS = $(LIBS) $(LDFLAGS)
DIST_FILES = Hanzim/hanzim.h Hanzim/hgb_utf.h \
Hanzim/hanzim.c Hanzim/hanwin.c Hanzim/hinit.c Hanzim/hutil.c \
@@ -87,16 +87,17 @@ DIST_FILES = Hanzim/hanzim.h Hanzim/hgb_
$(CC) $(CFLAGS) -c hutil.c
install : hanzim
- $(INSTALL) -s hanzim $(BINDIR)
- $(INSTALL) -m 0644 hanzim.man $(MANDIR)/man1/hanzim.1
- $(INSTALL) -m 0755 -d $(DOCDIR)
- $(INSTALL) -m 0644 hanzim.doc $(DOCDIR)
- $(INSTALL) -m 0755 -d $(LIBDIR)
- cd Data ; \
- $(INSTALL) -m 0644 hanwin.tcl fonts.unix fonts.windows \
+ $(BSD_INSTALL_PROGRAM) hanzim $(DESTDIR)$(BINDIR)
+ $(BSD_INSTALL_MAN) hanzim.man $(DESTDIR)$(MANDIR)/man1/hanzim.1
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(DOCDIR)
+ $(BSD_INSTALL_DATA) hanzim.doc $(DESTDIR)$(DOCDIR)
+ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(LIBDIR)
+ cd Data && \
+ $(BSD_INSTALL_DATA) hanwin.tcl fonts.unix \
zidianf.gb zidianfl.b5 bushou.gb \
- cidianf.gb sanzicidianf.gb parts.gb $(LIBDIR)
- $(BINDIR)/hanzim -buildDB
+ cidianf.gb sanzicidianf.gb parts.gb \
+ $(DESTDIR)$(LIBDIR)
+ HANZIM_LIB=$(DESTDIR)$(LIBDIR) $(DESTDIR)$(BINDIR)/hanzim -buildDB
uninstall :
$(RM) $(BINDIR)/hanzim
|