namazu-ml(avocado)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Namazu-1.1.1.2 Makefile for OS/2



清水@住友林業です。

では、Makefile です。

ちなみに、mknmz は mknmz.cmd・wdnmz は wdnmz.cmd、というコマンドファイルに
なります。(EXTPROC を使って perl を実行させています)

namazu.exe mknmz.cmd wdnmz.cmd の3つを path の通ったディレクトリに置けば、
カレントディレクトリがどこであっても使えます。

mknmz / mknmz.pl / wdnmz / wdnmz.pl は不要です。上記の3ファイルだけがあれ
ばいいです。

なお、GNU の TOOL 関係と GNUSED と Perl と emx gcc は別途用意してください。
perl は CPAN にある 5.004_01 を使っています。contrib の bnamazu はそのまま
では OS/2 で動きません。perl ではなく REXX インターフェースを準備する予定
ですが、あまり期待しないでください。


#################################################################
## Makefile for Namazu
## original of this file was made by Mr. Fumiyasu SATO. Thanks.
## Makefile for Namazu/2 was made by Kaz SHiMZ 

## for OS/2 EMX
SHELL		= sh.exe

##################################################################
## System
## select your system (UNIX or WIN32).

## for OS/2 EMX
## if your system is OS/2, specify WIN32.

SYSTEM		= OS2

##################################################################
## Directories

BASEDIR		= /usr/local
CGIDIR		= /www/cgi-bin    # for IBM ICS / ICSS httpd
NAMAZUDIR	= $(BASEDIR)/namazu
BINDIR_SYS	= $(BASEDIR)/bin  # install only 'namazu' command.
BINDIR		= $(NAMAZUDIR)/bin
INDEXDIR	= $(NAMAZUDIR)/index
DOCDIR		= $(NAMAZUDIR)/doc
LIBDIR		= $(NAMAZUDIR)/lib
CONTRIBDIR	= $(NAMAZUDIR)/contrib
TMPDIR		= f:/temp

##################################################################
## Pathname of namazu.conf

OPT_NAMAZU_CONF		= $(LIBDIR)/namazu.conf

##################################################################
## Programs' pathname
## if you intend to use Namazu with Win32, you should describe
## path by using \\\\ string for path separator.

OPT_PATH_PERL		= /usr/bin/perl
OPT_PATH_NKF		= nkf2
OPT_PATH_KAKASI		= kakasi
OPT_PATH_CHASEN		= /usr/local/bin/chasen

## Example for Win32
#OPT_PATH_NKF		= c:\\\\usr\\\\local\\\\bin\\\\nkf32
#OPT_PATH_KAKASI		= c:\\\\usr\\\\local\\\\bin\\\\kakasi

##################################################################
## Administrator's email address

OPT_ADMIN_EMAIL		= webmaster@xxxxxxxxxx

##################################################################
## CGI-BIN directory
## (relative URL)

OPT_URL_CGIBIN	= /cgi-bin

##################################################################
## Pathname of Helper Programs
##  * OPT_HELPER_ZCAT  :  program that expand compressed file

OPT_HELPER_ZCAT		= zcat

##################################################################
## Target for Make
##   * mknmz       :  Indexer
##   * wdnmz       :  Program that print registered words
##   * documents   :  same as left description :-)
##   * namazu.cgi  :  CGI     executable 
##   * namazu.fcgi :  FastCGI executable 
##   * namazu      :  UNIX    executable  (copy of namazu.cgi)
##   * namazu.exe  :  Win32   executable  (copy of namazu.cgi)

TARGET		= mknmz wdnmz documents mknmz.cmd wdnmz.cmd namazu.exe 
namazu.cgi.exe

##################################################################
## Target Files
## target file for indexing (case insensitive)
## ("_default" is a file httpdown would generate.)
## do *not* use '$' and '^' regular expression meta charactor.
## that will be automatically appended by mknmz.pl.
##
## *CAUTION*: '\' -> '\\', '$' -> '$$'

OPT_TARGET_FILE	= .*\\.html?|.*\\.txt|.*_default

##################################################################
## Deny Files
## this regular expression describes the names of the files which
## you do *not* want to index (case insensitive). this setting is
## effective when mknmz runs with -a option.
## do *not* use '$' and '^' regular expression meta charactor.
## that will be automatically appended by mknmz.pl.
##
## *CAUTION*: '\' -> '\\', '$' -> '$$'

OPT_DENY_FILE	= 
.*\\.gif|.*\\.(jpg|jpeg)|.*\\.tar\\.gz|core|.*\\.bak|.*~|\\..*|\\x23.*|NMZ\\.
.*

##################################################################
## Directory Index
## name of the file or files which can be abbreviated.
## (specify by regular expression)
## e.g. index.html|index.htm|Default.html
## it's useful to use Namazu as WWW search engine.
## ("_default" would be made by httpdown)

OPT_DEFAULT_FILE		= _default

##################################################################
## On Memory Max
## max size of memory allocated by index process.
## if you have much memory machine, you can increase this value
## and indexing speed will improve.

OPT_ON_MEMORY_MAX	= 5000000

##################################################################
## File Size Limitation
## the file larger than this value may not allowed to be indexed.

OPT_FILE_SIZE_LIMIT	= 1000000

##################################################################
## Japanese Processor
##   * KAKASI       :  use KAKASI
##   * CHASEN       :  use ChaSen
##   * CHASEN_MORPH :  use ChaSen with morphological processing

WAKACHI		= KAKASI

##################################################################
## Defines
##   * -DNOCONF   : no use namazu.conf

DEFINES	= -DINDEXDIR=\"$(INDEXDIR)\" -DTMPDIR=\"$(TMPDIR)\" \
	-D$(SYSTEM) -DOPT_PATH_KAKASI=\"$(OPT_PATH_KAKASI)\" \
	-DOPT_PATH_CHASEN=\"$(OPT_PATH_CHASEN)\" -D$(WAKACHI) \
	-DOPT_NAMAZU_CONF=\"$(OPT_NAMAZU_CONF)\"

##################################################################
## Flags
## optimize option and etc.

## for OS/2 EMX
EMXFLAGS	= -Zmts

INCLUDES	=
CFLAGS		= -O2 $(DEFINES) -Wall $(INCLUDES) $(EMXFLAGS)
LDFLAGS		= -lwrap -s

##################################################################
## FastCGI
##   -DFAST_CGI_DEBUG : Debug mode

FAST_CGI_DEFINES	= -DFAST_CGI
FAST_CGI_PATH		= /somewhere/fcgi-devel-kit/
FAST_CGI_INCLUDES	= -I $(FAST_CGI_PATH)/include
FAST_CGI_LIBS		= $(FAST_CGI_PATH)/libfcgi/libfcgi.a

##################################################################
## General Set-up

CC		= gcc
AR		= ar cq
DEPEND		= makedepend
RANLIB		= ranlib
RM		= rm -f
ARCDIR		= ../ARC


##################################################################

all:	$(TARGET)

mknmz: mknmz.pl
	rm -f $@
	sed -e 's!%OPT_PATH_PERL%!$(OPT_PATH_PERL)!g' \
	    -e 's!%OPT_SYSTEM%!$(SYSTEM)!g' \
	    -e 's!%OPT_PATH_NKF%!$(OPT_PATH_NKF)!g' \
	    -e 's!%OPT_PATH_KAKASI%!$(OPT_PATH_KAKASI)!g' \
	    -e 's!%OPT_PATH_CHASEN%!$(OPT_PATH_CHASEN)!g' \
	    -e 's!%OPT_HELPER_ZCAT%!$(OPT_HELPER_ZCAT)!g' \
	    -e 's!%OPT_WAKACHI_DEFAULT%!$(WAKACHI)!g' \
	    -e 's!%OPT_ADMIN_EMAIL%!$(OPT_ADMIN_EMAIL)!g' \
	    -e 's!%OPT_ADMIN_NAME%!$(OPT_ADMIN_NAME)!g' \
	    -e 's!%OPT_URL_CGIBIN%!$(OPT_URL_CGIBIN)!g' \
	    -e 's!%OPT_TARGET_FILE%!$(OPT_TARGET_FILE)!g' \
	    -e 's!%OPT_DENY_FILE%!$(OPT_DENY_FILE)!g' \
	    -e 's!%OPT_DEFAULT_FILE%!$(OPT_DEFAULT_FILE)!g' \
	    -e 's!%OPT_ON_MEMORY_MAX%!$(OPT_ON_MEMORY_MAX)!g' \
	    -e 's!%OPT_FILE_SIZE_LIMIT%!$(OPT_FILE_SIZE_LIMIT)!g' \
	    mknmz.pl > $@

wdnmz: wdnmz.pl
	rm -f $@
	sed -e 's!%OPT_PATH_PERL%!$(OPT_PATH_PERL)!g' \
	    -e 's!%OPT_SYSTEM%!$(SYSTEM)!g' \
	    -e 's!%OPT_PATH_NKF%!$(OPT_PATH_NKF)!g' \
	    wdnmz.pl > $@

mknmz.cmd: mknmz
	rm -f $@
	@echo "EXTPROC perl.exe -Sx" > mknmz.cmd
	cat mknmz >> mknmz.cmd

wdnmz.cmd: wdnmz
	rm -f $@
	@echo "EXTPROC perl.exe -Sx" > wdnmz.cmd
	cat wdnmz >> wdnmz.cmd

namazu.exe: srnmz.c
	@echo "== Compiling $@"
	$(CC) $(CFLAGS) srnmz.c $(LDFLAGS) -o $@

namazu.cgi.exe: namazu.exe
	cp namazu.exe namazu.cgi.exe

namazu.fcgi: srnmz.c
	@echo "== Compiling $@"
	$(CC) $(CFLAGS) $(FAST_CGI_DEFINES) $(FAST_CGI_INCLUDES) \
	 srnmz.c $(FAST_CGI_LIBS) -o $@

documents:
	echo $(HOGE);
	sed -e 's!"\(lynxcgi://localhost\).*"!"\1$(BINDIR)/namazu"!' \
		lynxcgi.html > lynxcgi.html.tmp
	mv lynxcgi.html.tmp lynxcgi.html

install: all
	if [ ! -d $(CGIDIR) ]; then \
	    mkdir -p $(CGIDIR); \
	fi
	if [ ! -d $(BINDIR) ]; then \
	    mkdir -p $(BINDIR); \
	fi
	if [ ! -d $(INDEXDIR) ]; then \
	    mkdir -p $(INDEXDIR); \
	fi
	if [ ! -d $(DOCDIR) ]; then \
	    mkdir -p $(DOCDIR); \
	fi
	if [ ! -d $(LIBDIR) ]; then \
	    mkdir -p $(LIBDIR); \
	fi
	if [ ! -d $(CONTRIBDIR) ]; then \
	    mkdir -p $(CONTRIBDIR); \
	fi
	if [ ! -d $(BINDIR_SYS) ]; then \
	    mkdir -p $(BINDIR_SYS); \
	fi
	cp namazu.cgi.exe $(CGIDIR)
	cp mknmz.cmd wdnmz.cmd namazu.exe $(BINDIR)
	cp *.html README ToDo ChangeLog COPYING $(DOCDIR)
	cp namazu.conf-dist $(LIBDIR)
	cp contrib/* $(CONTRIBDIR)
	cp namazu.exe $(BINDIR_SYS)

clean:
	$(RM) $(TARGET) srnmz.o namazu namazu.cgi namazu.fcgi namazu.exe

cleanall: clean
	#$(DEPEND) -- --
	$(RM) Makefile.bak

depend:
#	$(DEPEND) -- $(CFLAGS) -- $(SRCS)

tar:
	$(MAKE) cleanall
	(ARCHIVE=`pwd|sed 's@[^/]*/@@g'`; \
	    ( \
		cd ..; \
		tar cf - $${ARCHIVE}/* | \
		gzip -c \
	    ) > ${ARCDIR}/$${ARCHIVE}.tar.gz \
	)

end
--
  住友林業株式会社  情報システム部   清水 和佳
 
  TEL: +81-3-5322-6672  FAX: +81-3-5322-6658  Niftyserve: XLW01034
  e-mail: <kshimz@xxxxxxxxx>