######################
#    archive         #
######################

VER	=	2.2
REV	=	.10

SHAR	=	onew$(VER)$(REV).shar
TAR	=	onew$(VER)$(REV).tar
DIST	=	onew$(VER)$(REV).dist

VIAFS	=	via+onew.c ojstevie/via+stevie.c
SAMPLE	=	sample/Makefile sample/*.c

SRCS1	=	README.ONEW
SRCS2	=	Makefile mkmakefile mkrktab ONEW_CONF.default \
		engine/Makefile interface/Makefile dialogue/Makefile \
		sys/Makefile stabs/Makefile ojstevie/Makefile \
		*.h *.c \
		stabs/*.c \
		engine/*.h engine/*.c \
		interface/*.c \
		$(VIAFS) \
		$(SAMPLE) \
		ojstevie/ojstevie-patch ojstevie/onew+stevie.c \
		okdraw/okdraw-patch okdraw/onewedit.c \
		dialogue/*.c dialogue/keisen/*

SRCS	=	$(SRCS1) $(SRCS2)

LIBOBJS	=	onewver.o onewlib.o \
		onewclient.o onewcodes.o onewmisc.o \
		conf.o onew_euc.o rktab.o

RANLIB	=	echo

MAKEFILE =	Makefile.go
# BOOT_BEGIN ###########################################################
#
# -- ONEW_CONFIG.default -- ONEW$@$N%G%U%)%k%H4D6-@_Dj(J
#
# $@$3$N%U%!%$%k$G$O!"(Jonew$@$N%G%U%)%k%H(Jconfiguration$@$r5-=R$7$F$$$^$9!#(J
# $@0J2<$N5-=R$H0[$J$k@_Dj$K$9$k>l9g$K$O!"(J"ONEW_CONFIG" $@$H$$$&L>A0$N(J
# $@%U%!%$%k$r:n$C$F!"%G%U%)%k%H$H0[$J$kItJ,$r=q$-9~$s$G2<$5$$!#(J
#
# make $@;~$K!"%+%l%s%H%G%#%l%/%H%j$K(J "ONEW_CONFIG" $@$,L5$$>l9g$K$O!"(J
# $@>e0L%G%#%l%/%H%j$K8~$+$C$FC5:w$5$l$^$9!#(J

#################################################################
#  $@%m!<%^;z$+$J!&$+$J4A;zJQ49%(%s%8%s$N:n@.!&<B9T4D6-(J		#
#################################################################
#=======================#
#          WNN          #
#=======================#
# Wnn $@$r;HMQ$9$k>l9g$K$O!"0J2<$rE,@Z$K@_Dj$7$F2<$5$$(J

WNNINC		= -I/usr/local/wnn/include \
		  -I/usr/local/X11/include/wnn \
		  -I/usr/local/X11R5/include/wnn \
		  -I/usr/include/wnn \
		  -I/usr/local/include/wnn \
		  -I/usr/i18n/include/wnn

WNNLIB		= -L/usr/local/wnn/jlib.V3 \
		  -L/usr/local/X11/lib \
		  -L/usr/local/X11R5/lib \
		  -L/usr/local/lib \
		  -L/usr/local/lib/wnn \
		  -L/usr/i18n/lib \
		  -L/usr/X386/lib \
		  -ljd

# /usr/local/wnn/etc/xutoj.o

WNNOBJ		= Wnn.o WnnRomkan.o

# //////// Wnn$@<B9T;~$N4D6-$NDj5A(J ////////
#
# WNN_DICLIST
#       $@;HMQ$9$k<-=qL>$r6uGr$G6h@Z$C$FJB$Y$?$b$N!#(J
#       $@<-=qL>$N8e$K%*%W%7%g%s(J"=N"$@$rIU$1$FM%@hEY(JN$@$rI=$;$^$9!#(J
#
# WNN_DICDIRS
#       WNN_DICLIST$@$GDj5A$7$?<-=qL>$r%U%!%$%kL>$KJQ49$9$k$?$a$N%F%s%W%l!<%H!#(J
#       <$@<-=qL>%F%s%W%l!<%H(J>;<$@IQEYL>%F%s%W%l!<%H(J> $@$G;XDj$9$k!#(J
#       $@J#?tJB$Y$FDj5A$9$k$H!"<B9T;~$K@hF,$N$b$N$+$i=g$K;n$5$l$^$9!#(J
#
# $@!&(JWNN_DICDIRS$@Cf$N(J%s$@$N0LCV$K!"(JDICLIST$@$N3FMWAG<-=qL>$,Kd$a9~$^$l$^$9!#(J
# $@!&(JWNN_DICLIST$@Cf$N<-=qL>$G(J"/"$@$r4^$`$b$N(J(usr/$USER/ud$@$J$I(J)$@$O!"%G%U%)%k%H(J
#   $@$N<-=q%G%#%l%/%H%j$+$i$NAjBPL>$H$J$j$^$9!#(J
#
# WNN_RKPATH
#       $@%m!<%^;z$+$JJQ49%F!<%V%k$rC5:w$9$k%G%#%l%/%H%j$N%Q%9!#(J
#

WNNVER 		= WNN4
WNN_RKSPCL	= '"rk_spclval.h"'

WNN_DICLIST	= '"jinmei chimei computer kihon koyuu setsuji symbol tankan\
 bio special usr/$$USER/private=10 usr/$$USER/ud=10"'

WNN_DICDIRS	= '"pubdic/%s.dic;usr/$$USER/%s.h",\
		   "sys/%s.dic;usr/$$USER/%s.h"'

# $@IQEY<-=q$r8D?M$N%[!<%`%G%#%l%/%H%j$KCV$/>l9g$NDj5ANc(J
#WNN_DICDIRS	= '"sys/%s.dic;$$HOME/wnn/dic/%s.h"'

WNN_RKPATH	= '"./rk:$$ONEW_WNN_ROMKAND:$$ONEW_ROMKAND:$$HOME/.rk:/usr/local/lib/wnn/rk:/usr/local/wnn/ja_JP/rk:/usr/local/lib/wnn/ja_JP/rk:/tmp/onew_rktabs/wnn"'

#//// .... $@$5$9$,$K$b$&(JWnn3$@$O$$$i$J$$$+$J!)(J.... ////
#WNNVER 	= WNN3
#WNN_RKSPCL	= '"rk_spcl_val.h"'
#WNN_DICLIST	= '"jinmei chimei computer kihon koyuu setsuji symbol tankan\
# usr/$$USER/my-dict.usr"'
#WNN_DICDIRS	= '"sys/pd-%s.sys;usr/$$USER/pd-%s.hindo",\
#		   "sys/%s.sys;usr/$$USER/%s.hindo"'
#//// ......................................... ////

WNNDEF		= -DWNN_RKSPCL=$(WNN_RKSPCL) \
		  -DWNN_DICLIST=$(WNN_DICLIST) \
		  -DWNN_DICDIRS=$(WNN_DICDIRS) \
		  -DWNN_RKPATH=$(WNN_RKPATH)

#=======================#
#       CANNA           #
#=======================#
# Canna $@$r;HMQ$9$k>l9g$K$O!"0J2<$rE,@Z$K@_Dj$7$F2<$5$$(J

CANNAINC	= -I/usr/local/canna/include
CANNAOBJ	= Canna.o CannaRk.o
CANNALIB	= -L/usr/local/canna/lib \
		  -lcanna

# //////// Canna$@<B9T;~$N4D6-$NDj5A(J ////////
CANNA_RKPATH	= '".:$$HOME:/usr/local/canna/lib/dic:/tmp/onew_rktabs/canna"'
CANNA_RKTAB	= '"default.kp"'
CANNADEF	= -DCANNA_RKPATH=$(CANNA_RKPATH) -DCANNA_RKTAB=$(CANNA_RKTAB)


#---------------# $@%m!<%^;z$+$JJQ49%F!<%V%k$r(Jonew$@$KAH$_9~$_$K$9$k>l9g(J
#MKRKTAB	= rktab++
ONEW_RKTABS	= -DONEW_RKTABS='"/tmp/onew_rktabs"'

#################################################################
#	Available engines  $@;HMQ$9$k%(%s%8%s$NA*Br(J		#
#################################################################
#$@0J2<$N(J A),B),C) $@$N$&$A$$$:$l$+0l$D$rA*Br$7$F2<$5$$!#(J

#$@!z(J   A) WNN $@$N$_$r;HMQ$9$k>l9g(J
#RKKLIBS		= $(WNNLIB)
#RKKOBJS		= $(WNNOBJ)

#$@!z(J   B) Canna $@$N$_$r;HMQ$9$k>l9g(J
#RKKLIBS	= $(CANNALIB)
#RKKOBJS	= $(CANNAOBJ)

#$@!z(J   C) Wnn,Canna $@$r$H$b$K;HMQ$9$k>l9g(J
RKKLIBS	= $(CANNALIB) $(WNNLIB)
RKKOBJS	= $(CANNAOBJ) $(WNNOBJ)

#$@5/F0;~$N%G%U%)%k%H$N%(%s%8%s(J("$@%m!<%^;z$+$J(J/$@$+$J4A;z(J")
ONEW_ENGINE	= '"wnn/wnn"'
#($@$3$N@_Dj$O!"%(%s%8%s$,#1<oN`$7$+L5$$;~$K$OL5;k$5$l$^$9(J)
#################################################################
#	System dependency   $@%7%9%F%`0MB8$N@_Dj(J			#
#################################################################

###$@!z(J system type $@%7%9%F%`$N<oJL(J #### ($@$3$N@_Dj$O(Jsys/sys.h $@$K0z$C1[$7$^$7$?(J)
##SYSTYPE	= -DUSE_SGTTY
###SYSTYPE	= -DUSE_TERMIO
###SYSTYPE	= -DUSE_TERMIOS
##SELECT	= -DHAS_SELECT
###SELECT	= -DHAS_POLL
##SYSDEPEND 	= $(SYSTYPE) $(SELECT)

#$@!z(J compiler $@%3%s%Q%$%i$NA*Br(J
CC		= cc
#CC		= gcc
#CC		= /usr/ucb/cc
#CC		= /usr/5bin/cc

CFLAGS		= -O

#$@!z(J ranlib $@$,I,MW$J>l9g$KDj5A$7$F$M(J
RANLIB		= ranlib
#RANLIB		= touch			### System V

#$@!z(J linker $@%j%s%+(J(ld)$@$KEO$7$?$$0z?t$,$"$k>l9g$KDj5A$7$F$M(J
LDOPTS		=
#LDOPTS		= -Bstatic
#LDOPTS		= $$Binding

#$@!z(J $@$=$NB>$N%i%$%V%i%j(J
#MISCLIB	= -lsocket -lnsl -lgen   #### Solaris2, EWS4800

#$@!z(J ln -s (symbolic link)$@$r;H$o$J$$;~$K@_Dj$7$F$M(J
#NO_SYMLINK	= NO_SYMLINK

#################################################################
#	jstevie							#
#################################################################
OJLIBS		= -lonew $(RKKLIBS)
#OJLIBS		= -lonew -lvia $(RKKLIBS)

#################################################################
#	VIABUS interface					#
#################################################################
#VIALIB		= -via
#USEVIA		= -DVIA
#LIBDIR		= -L$$LIBDIR -L../lib

#################################################################
#	Setups for typical systems				#
#################################################################
### SunOS
### (default)

### DEC5000 / Ultrix
#CFLAGS		= -O -G 0

### HP-UX
#LDOPTS		= "-Wl,-a,archive"

####### CONFIG.default END ######################################

WNNINC		= -I/usr/local/include/wnn
WNNLIB		= -L/usr/local/lib -ljd
WNN_RKPATH      = '"./rk:$$ONEW_WNN_ROMKAND:$$ONEW_ROMKAND:$$HOME/.rk:/usr/local/lib/wnn/ja_JP/rk.wnn7:/usr/local/lib/wnn/ja_JP/rk:/tmp/onew_rktabs/wnn"'
WNN_DICLIST	= '"kihon tankan zip symbol tankan2 tel usr/$$USER/ud=10 usr/$$USER/private=10"'
WNN_DICDIRS	= '"system/%s.dic;usr/$$USER/%s.h"'
CANNAINC	= -I/usr/local/include
CANNAOBJ	= Canna.o CannaRk.o
CANNALIB	= -L/usr/local/lib -lcanna
CANNA_RKPATH	= '".:$$HOME:/usr/local/lib/canna/dic:/tmp/onew_rktabs/canna"'
CANNA_RKTAB	= '"default.cbp"'
RKKLIBS		= $(WNNLIB) $(CANNALIB)
RKKOBJS		= $(WNNOBJ) $(CANNAOBJ)
MISCLIB		= -lcrypt
# BOOT_END ############################################################

ALLLIBS	=	libonew.a $(RKKLIBS) $(VIALIB) $(MISCLIB)

.c.o:
	$(CC) -c $(CFLAGS) $*.c

MKCORE =	mkstabs mkinterface mkdialogue mksys

######################
#    libonew.a       #
######################
all:		$(MKCORE) libonewk.a mkengine libonew.a onew $(MKRKTAB)

test:		onew
		echo 'watasinonamaewa' | ./onew

clean:;		rm -f stabs/*.o  stabs/*.bak  stabs/core
		rm -f sample/*.o sample/*.bak sample/core
		cd engine; make clean
		cd dialogue; make clean
		rm -f sys/*.o sys/libsys.a sys/*.bak sys/core
		rm -f interface/*.o   interface/libuif.a 
		rm -f interface/*.bak interface/core
		rm -f $(MAKEFILE) *.o libonew*.a onew
		rm -f *.bak core

exe:		libonew.a onew

mkstabs:;	cd stabs; make CFLAGS="${CFLAGS}" CC="${CC}"
mkinterface:;	cd interface; make CFLAGS="${CFLAGS}" CC="${CC}"
mkdialogue:;	cd dialogue; make CFLAGS="${CFLAGS}" CC="${CC}"
mkengine:;	cd engine; make CFLAGS="${CFLAGS}" CC="${CC}"
mksys:;		cd sys; make CFLAGS="${CFLAGS}" CC="${CC}"


libonewk.a:	$(MAKEFILE) $(LIBOBJS) \
	interface/libuif.a dialogue/libdialogue.a sys/libsys.a
		rm -f libonewk.a
		ar rc libonewk.a $(LIBOBJS)
		ar r  libonewk.a interface/*.o
		ar r  libonewk.a dialogue/*.o
		ar r  libonewk.a sys/*.o
		$(RANLIB) libonewk.a

libonew.a:	libonewk.a engine/libengine.a
		cp libonewk.a libonew.a
		(cd engine; ar r ../libonew.a $(RKKOBJS))
		(cd stabs; ar r ../libonew.a *.o)
		$(RANLIB) libonew.a

onewlib.o:	onew.h onewlib.c
		$(CC) -c $(CFLAGS) onewlib.c

conf.o:		ONEW_CONF.default ONEW_CONF onew.h conf.c
		$(CC) -c $(CFLAGS) -DONEW_ENGINE=$(ONEW_ENGINE) $(ONEW_RKTABS)\
		 conf.c

onewclient.o:	onew.h onewclient.c
		$(CC) -c $(CFLAGS) onewclient.c

onew:		onew.o libonew.a
		$(CC) $(LDOPTS) -o onew onew.o sys/hpux.o $(ALLLIBS)

onew.o:		onew.h onew.c
		$(CC) -c $(CFLAGS) onew.c

onewver.o:	onew.h onewver.c

rktab.c:	mkrktab
		./mkrktab -
		rm -f rktab++

rktab++:	$(MAKEFILE) mkrktab engine/libengine.a
		./mkrktab +
		touch rktab++
		make

######################
#    onew + stevie   #
######################
stevie:			ojstevie/ojstevie
ojstevie/ojstevie:	$(SRCS)
			cd ojstevie; make

######################
#    onew + kdraw    #
######################
idraw:		okdraw/okdraw
okdraw/okdraw:	kdraw/SUN4/a.out
		cp kdraw/SUN4/a.out okdraw/okdraw

kdraw/SUN4/a.out:\
	libonew.a \
	okdraw/textedit.h okdraw/textedit.c okdraw/onewedit.c okdraw/main.c
	cd kdraw/SUN4; make

######################
#    archive         #
######################
ar:		shar tar dist
shar:		$(SHAR)
$(SHAR):	$(SRCS)
		echo "mkdir ojstevie; mkdir okdraw" > $(SHAR); \
		shar2 -v $(SRCS) >> $(SHAR); \
		cp -p $(SHAR) onew.shar

tar:		$(TAR)
$(TAR):		$(SRCS) sys/*.h sys/*.c
		rm -f rktab.c
		tar cf  $(TAR) $(SRCS)
		tar uhf $(TAR) sys/*.h sys/*.c
		cp -p $(TAR) onew.tar

uu:		tar
		gzip -9 $(TAR)
		uuencode $(TAR).gz $(TAR).gz > uu

dist:		$(DIST)
$(DIST):	$(SRCS) $(TAR)
		compress $(TAR) -c |uuencode $(TAR).Z > $(DIST)

ver:;		echo $(WNNVER)
LibSpec:;	echo "'"$(RKKLIBS)"'"


syntax highlighted by Code2HTML, v. 0.9.1