File: Imakefile

package info (click to toggle)
canna 3.7p3-13
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,220 kB
  • ctags: 9,776
  • sloc: ansic: 85,928; sh: 2,777; yacc: 403; cpp: 389; lex: 379; makefile: 74; awk: 7
file content (195 lines) | stat: -rw-r--r-- 5,988 bytes parent folder | download | duplicates (4)
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
/* $Id: Imakefile,v 1.12.2.4 2004/05/19 15:39:22 aida_s Exp $ */
#include "./Canna.conf"

#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
#ifndef ConfigureArgs
# define ConfigureArgs
#endif
#if UseInet6
# define CannaConfInet6 echo "#define INET6"
#else
# define CannaConfInet6 echo "/* #undef INET6 */"
#endif

      CANNAROOT = .
      WORLDOPTS = /* -k */
        SUBDIRS = lib canna server cmd dic misc doc
        INCLUDE = ./include/canna
     RKIINCLUDE = ./include/RKindep
        DEFINES = $(CANNA_DEFINES)
CONFIGURE_CMD = IN_MAKE=yes $(CANNAROOT)/confwrapper run ./configure --prefix=$(cannaPrefix) ConfigureArgs
PURE_CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) /* $(THREADS_CFLAGS) $(MODULE_CFLAGS) */
supportOldWchar = SupportOldWchar


AllTarget(cannaconf.h accanna.h pubconf.h)
MakeSubdirs($(SUBDIRS))
DependSubdirs($(SUBDIRS))

clean::
	$(RM) -r include cannaconf.h
distclean::
	$(RM) accanna.h config.log config.cache config.status pubconf.h cwenv.sh

includes:: cannaconf.h accanna.h pubconf.h
	$(RM) -r include
	MakeDir($(INCLUDE))
	MakeDir($(RKIINCLUDE))

/* �ʲ��� cannaconf.h ����롼�� */
cannaconf.h: Canna.conf
	@echo "creating $@"
#ifdef OS2Architecture
	@echo "#ifndef CANNACONF_H" > junkjunk
	@echo "#define CANNACONF_H" >> junkjunk
	@echo "#include \"accanna.h\"" >> junkjunk
	@echo "#ifdef malloc" >> junkjunk
	@echo "# undef malloc" >> junkjunk
	@echo "#endif" >> junkjunk
	@echo "/* for cannaserver */" >> junkjunk
	@echo "#define DICHOME '$(DicDir)'" >> junkjunk
	@echo "#define ERRDIR '$(ErrDir)'" >> junkjunk
	@echo "#define USE_INET_SOCKET" >> junkjunk
	@echo "#define ACCESS_FILE '$(AccessFile)'" >> junkjunk
	@echo "/* for lib/RKC */" >> junkjunk
	@echo "#define CANNAHOSTFILE '$(cannaLibDir)/cannahost'" >> junkjunk
	@echo "/* for lib/canna */" >> junkjunk
	@echo "#define CANNALIBDIR '$(cannaLibDir)'" >> junkjunk
	@echo "#define SUPPORT_OLD_WCHAR '$(supportOldWchar)'" >> junkjunk
	@echo "/* for scripts */" >> junkjunk
	@echo "#define CANNABINDIR $(cannaBinDir)" >> junkjunk
	@echo "/* others */" >> junkjunk
	@echo "#define CANNA_LIGHT $(cannaLight)" >> junkjunk
	@echo "#ifdef nec" >> junkjunk
	@echo "#undef nec" >> junkjunk
	@echo "#endif" >> junkjunk
	@CannaConfInet6 >> junkjunk
	@echo "#endif /* !CANNACONF_H */" >> junkjunk
	@sed -e "s/'/\\\"/" -e "s/'/\\\"/" < junkjunk > junk
	@$(RM) junkjunk
#else
	@(echo "#ifndef CANNACONF_H";\
	 echo "#define CANNACONF_H";  \
	 echo "#include \"accanna.h\"";  \
	 echo "#ifdef malloc"; \
	 echo "# undef malloc"; \
	 echo "#endif"; \
	 echo "/* for cannaserver */";  \
	 echo "#define DICHOME \"$(DicDir)\"";  \
	 echo "#define ERRDIR \"$(ErrDir)\"";   \
	 echo "#define USE_UNIX_SOCKET"; \
	 echo "#define USE_INET_SOCKET"; \
	 echo "#define IR_UNIX_DIR \"$(UnixSockDir)\""; \
	 echo "#define IR_UNIX_SOCKNAME \"$(UnixSockName)\""; \
	 echo "#define ACCESS_FILE \"$(AccessFile)\""; \
	 echo "/* for lib/RKC */";\
	 echo "#define CANNAHOSTFILE \"$(cannaLibDir)/cannahost\"";\
	 echo "/* for lib/canna */";\
	 echo "#define CANNALIBDIR \"$(cannaLibDir)\""; \
	 echo "#define SUPPORT_OLD_WCHAR $(supportOldWchar)"; \
	 echo "#define CANNASHAREDIR \"$(cannaShareDir)\""; \
	 echo "/* for scripts */";\
	 echo "#define CANNABINDIR $(cannaBinDir)"; \
	 echo "/* others */";\
	 echo "#define CANNA_LIGHT $(cannaLight)"; \
	 echo "#ifdef nec"; \
	 echo "#undef nec"; \
	 echo "#endif"; \
	 CannaConfInet6; \
	 echo "#endif /* !CANNACONF_H */") > junk
#endif /* OS2Architecture */
	@if test -r $@ && cmp -s junk $@; then \
	   echo "$@ unchanged"; \
	   rm junk; \
	 else \
	   mv junk $@; \
	 fi

XCOMM Invoke configure only when accanna.h does not exist for faster build
accanna.h pubconf.h:
	$(CONFIGURE_CMD)
XCOMM If you want to invoke configure explicitly, do "make config"
config::
	$(CONFIGURE_CMD)
reconfig::
	$(RM) config.cache cwenv.sh
	$(CONFIGURE_CMD)
XCOMM Invoked from confwrapper
cwenv.sh:
	$(CANNAROOT)/confwrapper mkenv CPPFLAGS $(ALLDEFINES) > $@
	$(CANNAROOT)/confwrapper mkenv CC env $(CC) >> $@
	$(CANNAROOT)/confwrapper mkenv CFLAGS $(PURE_CFLAGS) >> $@

CANNAROOT = .
SERVERDIR = server dic/phono dic/ideo
CLIENTDIR = cmd dic/phono misc
SGSDIR = canna lib
MOSTDIR = lib canna server cmd dic/phono misc doc

install:: mkbindir mklibdir mkdicdir mkerrdir
instserver:: mkdicdir mkerrdir
instclient:: mkbindir mkdicdir
instsgs:: mklibdir
instmost:: mkbindir mklibdir mkdicdir mkerrdir

MakeDirectories(mkbindir, $(cannaBinDir))
MakeDirectories(mklibdir, $(cannaLibDir))
#ifdef InstallAsUser
MakeDirectories(mkdicdir, $(DicDir))
MakeDirectories(mkerrdir, $(ErrDir))
#else
MakeDirectoriesLong(mkdicdir, $(DicDir), $(cannaOwner), $(cannaGroup))
MakeDirectoriesLong(mkerrdir, $(ErrDir), $(cannaOwner), $(cannaGroup))
#endif

LinkFileList(includes,cannaconf.h,$(CANNAROOT)/include,..)
LinkFileList(includes,accanna.h,$(CANNAROOT)/include,..)
LinkFileList(includes,pubconf.h,$(CANNAROOT)/include/canna,../..)
InstallMultiple(pubconf.h,$(cannaIncDir))

canna:: 
	@echo ""
	@echo "Building canna"
	@echo ""
	@echo ""
	$(MAKE) Makefiles
	$(MAKE) clean
	$(MAKE) includes
	$(MAKE) -k depend
	$(MAKE) $(WORLDOPTS)
	@echo ""
	@date
	@echo ""

instserver::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SERVERDIR) ;\
	do \
		(cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \
		$(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \
	done

instclient::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(CLIENTDIR) ;\
	do \
		(cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \
		$(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \
	done

instsgs::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(SGSDIR) ;\
	do \
		(cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \
		$(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \
	done

instmost::
	@case '${MFLAGS}' in *[ik]*) set +e;; esac; \
	for i in $(MOSTDIR) ;\
	do \
		(cd $$i ; echo "installing" "in $(CURRENT_DIR)/$$i..."; \
		$(MAKE) $(MFLAGS) DESTDIR='$(DESTDIR)' install); \
	done