hawk/lib/Makefile.am

311 lines
7.4 KiB
Makefile
Raw Normal View History

2019-12-13 04:29:58 +00:00
AUTOMAKE_OPTIONS = nostdinc
CPPFLAGS_ALL_COMMON = \
-I$(abs_builddir) \
-I$(abs_srcdir) \
2020-11-14 08:03:16 +00:00
-I$(includedir)
2019-12-13 04:29:58 +00:00
CFLAGS_ALL_COMMON =
CXXFLAGS_ALL_COMMON =
2020-11-15 04:50:40 +00:00
2019-12-13 04:29:58 +00:00
if ENABLE_STATIC_MODULE
LDFLAGS_ALL_COMMON = -L$(abs_builddir)/../mod -L$(abs_builddir) -L$(libdir)
2019-12-13 04:29:58 +00:00
else
LDFLAGS_ALL_COMMON = -L$(abs_builddir) -L$(libdir)
2019-12-13 04:29:58 +00:00
endif
##################################################
# MAIN LIBRARY
##################################################
if WIN32
# you must adjust the value of DEFAULT_MODPOSTFIX according
# to the first number in -version-info above
CPPFLAGS_PFMOD = -DHAWK_DEFAULT_MODLIBDIRS=\"\" -DHAWK_DEFAULT_MODPREFIX=\"libhawk-\" -DHAWK_DEFAULT_MODPOSTFIX=\"-1.dll\"
2019-12-13 04:29:58 +00:00
else
CPPFLAGS_PFMOD = -DHAWK_DEFAULT_MODLIBDIRS=\"$(libdir)\" -DHAWK_DEFAULT_MODPREFIX=\"libhawk-\"
2019-12-13 04:29:58 +00:00
if MACOSX
CPPFLAGS_PFMOD += -DHAWK_DEFAULT_MODPOSTFIX=\".dylib\"
else
CPPFLAGS_PFMOD += -DHAWK_DEFAULT_MODPOSTFIX=\".so\"
endif
endif
2022-06-13 14:32:41 +00:00
EXTRA_DIST = \
2022-07-16 08:08:05 +00:00
gem-glob.c.m4 \
gem-glob.m4 \
2022-06-13 14:32:41 +00:00
hawk-str.h.m4 \
utl-str.c.m4 \
utl-str.m4
BUILT_SOURCES = \
2022-07-16 08:08:05 +00:00
gem-glob.c \
2022-06-13 14:32:41 +00:00
hawk-str.h \
utl-str.c
2019-12-13 04:29:58 +00:00
##################################################
# include files to deploy
##################################################
pkgincludedir = $(includedir)
pkginclude_HEADERS = \
hawk.h \
2020-01-15 06:00:52 +00:00
hawk-arr.h \
2019-12-13 04:29:58 +00:00
hawk-chr.h \
hawk-cmn.h \
2019-12-20 14:55:10 +00:00
hawk-dir.h \
2019-12-13 04:29:58 +00:00
hawk-ecs.h \
hawk-fmt.h \
2019-12-13 08:26:54 +00:00
hawk-gem.h \
2022-07-16 08:08:05 +00:00
hawk-glob.h \
2019-12-13 04:29:58 +00:00
hawk-htb.h \
hawk-map.h \
2019-12-13 04:29:58 +00:00
hawk-rbt.h \
hawk-pac1.h \
2021-08-18 06:35:48 +00:00
hawk-skad.h \
2019-12-13 04:29:58 +00:00
hawk-utl.h \
2022-03-24 16:43:05 +00:00
hawk-sed.h \
2019-12-13 04:29:58 +00:00
hawk-std.h \
hawk-tre.h \
hawk-upac.h \
2020-11-02 09:54:12 +00:00
hawk-xma.h
2019-12-13 04:29:58 +00:00
##################################################
# libraries to deploy
##################################################
pkglibdir = $(libdir)
pkglib_LTLIBRARIES = libhawk.la
2020-01-15 06:00:52 +00:00
libhawk_la_SOURCES = \
2019-12-13 04:29:58 +00:00
$(pkginclude_HEADERS) \
arr.c \
chr.c \
2019-12-20 14:55:10 +00:00
dir.c \
2019-12-13 04:29:58 +00:00
ecs-imp.h \
ecs.c \
err-prv.h \
err.c \
err-sys.c \
2019-12-13 04:29:58 +00:00
fmt-imp.h \
fmt.c \
fnc-prv.h \
fnc.c \
htb.c \
2019-12-13 08:26:54 +00:00
gem.c \
2022-07-16 08:08:05 +00:00
gem-glob.c \
gem-nwif.c \
gem-nwif2.c \
2019-12-13 04:29:58 +00:00
hawk-prv.h \
hawk.c \
idmap-imp.h \
2019-12-13 04:29:58 +00:00
mb8.c \
2020-11-15 08:46:30 +00:00
misc-imp.h \
2019-12-13 04:29:58 +00:00
misc-prv.h \
misc.c \
parse-prv.h \
parse.c \
rbt.c \
rec.c \
rio-prv.h \
rio.c \
run-prv.h \
run.c \
2022-03-24 16:43:05 +00:00
sed-prv.h \
sed.c \
2021-08-18 06:40:08 +00:00
skad-prv.h \
2021-08-18 06:35:48 +00:00
skad.c \
2019-12-13 04:29:58 +00:00
tre-prv.h \
tre-ast.c \
tre-ast.h \
tre-compile.c \
tre-compile.h \
tre-match-bt.c \
tre-match-pa.c \
tre-match-ut.h \
2019-12-20 03:15:03 +00:00
tre-mem.c \
tre-mem.h \
2019-12-13 04:29:58 +00:00
tre-parse.c \
tre-parse.h \
tre-stack.h \
2020-01-15 06:00:52 +00:00
tre-stack.c \
2019-12-13 04:29:58 +00:00
tre.c \
tree-prv.h \
tree.c \
2020-01-15 06:00:52 +00:00
uch-prop.h \
uch-case.h \
2019-12-13 04:29:58 +00:00
utf16.c \
utf8.c \
2019-12-21 16:59:00 +00:00
utl-ass.c \
utl-cmgr.c \
2022-03-31 17:14:52 +00:00
utl-rnd.c\
2019-12-13 04:29:58 +00:00
utl-sort.c \
utl-str.c \
utl-sys.c \
2022-06-13 13:55:22 +00:00
utl-xstr.c \
2019-12-13 04:29:58 +00:00
utl.c \
val-prv.h \
2020-11-02 09:54:12 +00:00
val.c \
xma.c
2019-12-13 04:29:58 +00:00
libhawk_la_SOURCES += \
hawk-cli.h \
hawk-fio.h \
hawk-mtx.h \
hawk-pio.h \
hawk-sio.h \
2022-09-26 07:19:42 +00:00
hawk-str.h \
2019-12-13 04:29:58 +00:00
hawk-tio.h \
2020-01-15 06:00:52 +00:00
cli-imp.h \
2019-12-13 04:29:58 +00:00
cli.c \
fio.c \
mtx.c \
pio.c \
sio.c \
syscall.h \
tio.c \
2022-03-31 17:14:52 +00:00
std.c \
std-sed.c
2019-12-13 04:29:58 +00:00
2020-02-27 07:49:04 +00:00
libhawk_la_CPPFLAGS = $(CPPFLAGS_ALL_COMMON) $(CPPFLAGS_PFMOD)
2020-11-14 08:03:16 +00:00
libhawk_la_CFLAGS = $(CFLAGS_ALL_COMMON)
libhawk_la_CXXFLAGS = $(CXXFLAGS_ALL_COMMON)
libhawk_la_LDFLAGS = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 ## -no-undefined
## socket() is used in gem-nwif.c and gem-nwif2.c
libhawk_la_LIBADD = $(LIBM) $(SOCKET_LIBS)
2019-12-13 04:29:58 +00:00
if ENABLE_LIBLTDL
libhawk_la_CPPFLAGS += $(LTDLINCL)
libhawk_la_LIBADD += $(LTDL_LIBS)
else
libhawk_la_LIBADD += $(DL_LIBS)
endif
if ENABLE_LIBUNWIND
libhawk_la_LIBADD += $(UNWIND_LIBS)
endif
2019-12-13 04:29:58 +00:00
if ENABLE_CXX
2022-06-04 15:00:13 +00:00
pkginclude_HEADERS += Hawk.hpp Hawk-Sed.hpp
libhawk_la_SOURCES += Hawk.cpp Std.cpp Sed.cpp Std-Sed.cpp
2020-02-27 07:49:04 +00:00
###libhawk_la_LINK = $(CXXLINK)
libhawk_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(libhawk_la_LDFLAGS) $(LDFLAGS) -o $@
else
## as long as a c++ file is listed in the SOURCES list, automake chooses
## --tag=CXX and $(CXXLD) for the linker regardless of ENABLE_CXX.
## i want $(CCLD) to be used when CXX is disabled because a fatal problem
## arises when CXXLD is chosen but the system doesn't have a c++ compiler.
##
##libhawk_la_LINK = $(LINK)
## $(LINK) includes $(AM_LDFLAGS) instead of $(libhawk_la_LDFLAGS)
## so i compose the entire libhawk specific LINK line below.
libhawk_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) \
$(CFLAGS) $(libhawk_la_LDFLAGS) $(LDFLAGS) -o $@
2019-12-13 04:29:58 +00:00
endif
if ENABLE_STATIC_MODULE
##################################################
# STATIC MODULES BUILT INTO MAIN LIBRARY
##################################################
libhawk_la_SOURCES += \
mod-hawk.c mod-hawk.h \
2019-12-13 04:29:58 +00:00
mod-math.c mod-math.h \
2019-12-20 14:55:10 +00:00
mod-str.c mod-str.h \
mod-sys.c mod-sys.h
2020-11-14 07:35:47 +00:00
libhawk_la_LIBADD += $(SOCKET_LIBS)
2019-12-13 04:29:58 +00:00
2020-12-17 10:12:57 +00:00
if ENABLE_MOD_FFI
libhawk_la_LIBADD += ../mod/libhawk-ffi.la
endif
2019-12-13 04:29:58 +00:00
if ENABLE_MOD_MYSQL
libhawk_la_LIBADD += ../mod/libhawk-mysql.la
2019-12-13 04:29:58 +00:00
endif
if ENABLE_MOD_SED
libhawk_la_LIBADD += ../mod/libhawk-sed.la
endif
2019-12-13 04:29:58 +00:00
if ENABLE_MOD_UCI
libhawk_la_LIBADD += ../mod/libhawk-uci.la
2019-12-13 04:29:58 +00:00
endif
else
##################################################
# DYNAMIC MODULES
##################################################
CPPFLAGS_MOD_COMMON = $(CPPFLAGS_ALL_COMMON)
2020-11-14 08:03:16 +00:00
CFLAGS_MOD_COMMON = $(CFLAGS_ALL_COMMON)
CXXFLAGS_MOD_COMMON = $(CXXFLAGS_ALL_COMMON)
2019-12-13 04:29:58 +00:00
LDFLAGS_MOD_COMMON = $(LDFLAGS_ALL_COMMON)
LIBADD_MOD_COMMON = libhawk.la
2019-12-13 04:29:58 +00:00
#pkglibdir = $(libdir)
#pkglib_LTLIBRARIES =
pkglib_LTLIBRARIES += libhawk-hawk.la
libhawk_hawk_la_SOURCES = mod-hawk.c mod-hawk.h
libhawk_hawk_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON)
2020-11-14 08:03:16 +00:00
libhawk_hawk_la_CFLAGS = $(CFLAGS_MOD_COMMON)
libhawk_hawk_la_CXXFLAGS = $(CXXFLAGS_MOD_COMMON)
libhawk_hawk_la_LDFLAGS = $(LDFLAGS_MOD_COMMON)
libhawk_hawk_la_LIBADD = $(LIBADD_MOD_COMMON)
pkglib_LTLIBRARIES += libhawk-math.la
libhawk_math_la_SOURCES = mod-math.c mod-math.h
libhawk_math_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON)
2020-11-14 08:03:16 +00:00
libhawk_math_la_CFLAGS = $(CFLAGS_MOD_COMMON)
libhawk_math_la_CXXFLAGS = $(CXXFLAGS_MOD_COMMON)
libhawk_math_la_LDFLAGS = $(LDFLAGS_MOD_COMMON)
2020-11-14 07:35:47 +00:00
libhawk_math_la_LIBADD = $(LIBADD_MOD_COMMON) $(LIBM)
pkglib_LTLIBRARIES += libhawk-str.la
libhawk_str_la_SOURCES = mod-str.c mod-str.h
libhawk_str_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON)
2020-11-14 08:03:16 +00:00
libhawk_str_la_CFLAGS = $(CFLAGS_MOD_COMMON)
libhawk_str_la_CXXFLAGS = $(CXXFLAGS_MOD_COMMON)
libhawk_str_la_LDFLAGS = $(LDFLAGS_MOD_COMMON)
libhawk_str_la_LIBADD = $(LIBADD_MOD_COMMON)
pkglib_LTLIBRARIES += libhawk-sys.la
libhawk_sys_la_SOURCES = mod-sys.c mod-sys.h
libhawk_sys_la_CPPFLAGS = $(CPPFLAGS_MOD_COMMON)
2020-11-14 08:03:16 +00:00
libhawk_sys_la_CFLAGS = $(CFLAGS_MOD_COMMON)
libhawk_sys_la_CXXFLAGS = $(CXXFLAGS_MOD_COMMON)
libhawk_sys_la_LDFLAGS = $(LDFLAGS_MOD_COMMON)
2020-11-14 07:35:47 +00:00
libhawk_sys_la_LIBADD = $(LIBADD_MOD_COMMON) $(SOCKET_LIBS)
2019-12-13 04:29:58 +00:00
endif
2020-01-04 05:21:00 +00:00
##############################################################
# installation
##############################################################
install-data-hook:
@echo "#ifndef _HAWK_CFG_H_" > "$(DESTDIR)$(pkgincludedir)/hawk-cfg.h"
@echo "#define _HAWK_CFG_H_" >> "$(DESTDIR)$(pkgincludedir)/hawk-cfg.h"
@$(EGREP) "#define[ ]+HAWK_" "$(abs_builddir)/hawk-cfg.h" >> "$(DESTDIR)$(pkgincludedir)/hawk-cfg.h"
@echo "#endif" >> "$(DESTDIR)$(pkgincludedir)/hawk-cfg.h"
@rm -f "$(DESTDIR)$(pkgincludedir)/hawk-cfg.h.in"
@$(SED) 's|/\*#define HAWK_HAVE_CFG_H\*/|#define HAWK_HAVE_CFG_H|' "$(srcdir)/hawk-cmn.h" > "$(DESTDIR)$(pkgincludedir)/hawk-cmn.h"
uninstall-hook:
@rm -f "$(DESTDIR)$(pkgincludedir)/hawk-cfg.h"
2022-06-13 14:32:41 +00:00
2022-07-16 08:08:05 +00:00
gem-glob.c: gem-glob.m4 gem-glob.c.m4
m4 -I$(srcdir) $(srcdir)/gem-glob.c.m4 > $(srcdir)/gem-glob.c
2022-06-13 14:32:41 +00:00
hawk-str.h: utl-str.m4 hawk-str.h.m4
m4 -I$(srcdir) $(srcdir)/hawk-str.h.m4 > $(srcdir)/hawk-str.h
utl-str.c: utl-str.m4 utl-str.c.m4
m4 -I$(srcdir) $(srcdir)/utl-str.c.m4 > $(srcdir)/utl-str.c