php-src/ext/mbstring/oniguruma/Makefile.in

189 lines
4.5 KiB
Makefile
Raw Normal View History

# Oni Guruma Makefile
product_name = oniguruma
dist_tag = `date '+%Y%m%d'`
SHELL = /bin/sh
AUTOCONF = autoconf
CPPFLAGS =
CFLAGS = @CFLAGS@ @STATISTICS@
LDFLAGS =
LOADLIBES =
AR = ar
ARFLAGS = rc
RANLIB = @RANLIB@
INSTALL = install -c
CP = cp -p
CC = @CC@
DEFS = @DEFS@ -DNOT_RUBY
RUBYDIR = @RUBYDIR@
WIN32 = win32
DOC = doc
srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
subdirs =
libname = libonig.a
onigintheaders = regint.h regparse.h
onigheaders = oniguruma.h $(onigintheaders)
posixheaders = onigposix.h
headers = $(posixheaders) $(onigheaders)
onigobjs = regerror.o regparse.o regcomp.o regexec.o reggnu.o
posixobjs = regposix.o regposerr.o
libobjs = $(onigobjs) $(posixobjs)
onigsources = regerror.c regparse.c regcomp.c regexec.c reggnu.c
posixsources = regposix.c regposerr.c
libsources = $(posixsources) $(onigsources)
rubysources = regex.c $(onigsources)
patchfiles = re.c.168.patch re.c.180.patch
distfiles = README COPYING INSTALL-RUBY HISTORY \
.cvsignore Makefile.in configure.in config.h.in configure \
$(headers) $(libsources) regex.c $(patchfiles) \
test.rb testconv.rb $(testc).c
win32distfiles = $(WIN32)/Makefile $(WIN32)/config.h $(WIN32)/testc.c
docfiles = $(DOC)/API $(DOC)/RE
samplefiles = sample/*.c
testc = testc
testp = testp
makeargs = $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CC='$(CC)'
.SUFFIXES:
.SUFFIXES: .o .c .h .ps .dvi .info .texinfo
.c.o:
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $<
# targets
default: all
all: $(libname)
$(libname): $(libobjs)
rm -f $(libname)
$(AR) $(ARFLAGS) $(libname) $(libobjs)
$(RANLIB) $(libname)
regparse.o: regparse.c $(onigheaders) config.h
regcomp.o: regcomp.c $(onigheaders) config.h
regexec.o: regexec.c regint.h oniguruma.h config.h
reggnu.o: reggnu.c regint.h oniguruma.h config.h
regerror.o: regerror.c regint.h oniguruma.h config.h
regposix.o: regposix.c $(posixheaders) oniguruma.h config.h
regposerr.o: regposerr.c $(posixheaders) config.h
install: all
test -d $(libdir) || mkdir $(libdir)
test -d $(includedir) || mkdir $(includedir)
$(INSTALL) $(libname) $(libdir)/$(libname)
$(RANLIB) $(libdir)/$(libname)
$(INSTALL) $(srcdir)/oniguruma.h $(includedir)/oniguruma.h
$(INSTALL) $(srcdir)/onigposix.h $(includedir)/onigposix.h
uninstall:
-rm -f $(libdir)/$(libname)
-rm -f $(includedir)/oniguruma.h
# Ruby test
rtest:
$(RUBYDIR)/ruby -w -Ke test.rb
# C library test
ctest: $(testc)
./$(testc)
# POSIX C library test
ptest: $(testp)
./$(testp)
$(testc): $(testc).c $(libname)
$(CC) $(CFLAGS) -o $@ $(testc).c $(libname)
$(testp): $(testc).c $(libname)
$(CC) -DPOSIX_TEST $(CFLAGS) -o $@ $(testc).c $(libname)
$(testc).c: test.rb testconv.rb
ruby -Ke testconv.rb < test.rb > $@
$(WIN32)/$(testc).c: test.rb testconv.rb
ruby -Ke testconv.rb -win < test.rb | nkf -cs > $@
clean:
rm -f *.o $(libname) $(testc) $(testp) $(testc) *~ win32/*~
distclean: clean
rm -f Makefile config.status
16: cpruby
patch -d $(RUBYDIR) -p0 < re.c.168.patch
18: cpruby
patch -d $(RUBYDIR) -p0 < re.c.180.patch
# backup file suffix
SORIG = ruby_orig
cpruby:
$(CP) $(RUBYDIR)/regex.c $(RUBYDIR)/regex.c.$(SORIG)
$(CP) $(RUBYDIR)/regex.h $(RUBYDIR)/regex.h.$(SORIG)
$(CP) $(RUBYDIR)/re.c $(RUBYDIR)/re.c.$(SORIG)
$(CP) $(rubysources) $(onigintheaders) $(RUBYDIR)
$(CP) oniguruma.h $(RUBYDIR)/regex.h
rback:
$(CP) $(RUBYDIR)/regex.c.$(SORIG) $(RUBYDIR)/regex.c
$(CP) $(RUBYDIR)/regex.h.$(SORIG) $(RUBYDIR)/regex.h
$(CP) $(RUBYDIR)/re.c.$(SORIG) $(RUBYDIR)/re.c
samples:
$(CC) $(CFLAGS) -I. -o sample/simple sample/simple.c $(libname)
$(CC) $(CFLAGS) -I. -o sample/posix sample/posix.c $(libname)
$(CC) $(CFLAGS) -I. -o sample/names sample/names.c $(libname)
configure: configure.in
$(AUTOCONF)
config.status: configure
$(SHELL) ./config.status --recheck
Makefile: Makefile.in config.status
$(SHELL) ./config.status
# Prevent GNU make 3 from overflowing arg limit on system V.
.NOEXPORT:
manifest:
for file in $(distfiles); do echo $$file; done
distdir = $(product_name)
dist_auto: $(testc).c $(WIN32)/$(testc).c
dist: configure dist_auto
rm -rf $(distdir)
mkdir $(distdir)
mkdir $(distdir)/$(DOC)
mkdir $(distdir)/$(WIN32)
mkdir $(distdir)/sample
ln $(distfiles) $(distdir)
ln $(docfiles) $(distdir)/$(DOC)
ln $(win32distfiles) $(distdir)/$(WIN32)
ln $(samplefiles) $(distdir)/sample
tar chf - $(distdir) | gzip > onigd$(dist_tag).tar.gz
rm -rf $(distdir)