SUBDIRS = xml id-ff id-wsf

liblassoincludedir = $(includedir)/lasso

INCLUDES = -I$(top_srcdir) $(LASSO_CORE_CFLAGS)

## Added to activate libtool 1.5.6 windows resources partial support
LTRCCOMPILE = $(LIBTOOL) --tag=RC --mode=compile $(RC) \
     `echo $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) |\
         sed -e 's/-I/--include-dir /g;s/-D/--define /g'`

## Added to activate libtool 1.5.6 windows resources partial support
lasso.rc.lo: $(top_srcdir)/win32/lasso.rc
	$(LTRCCOMPILE) -i $< -o $@


lib_LTLIBRARIES = liblasso.la

liblassoinclude_HEADERS = export.h lasso.h lasso_config.h errors.h
BUILT_SOURCES = types.c symbols.sym

liblasso_la_SOURCES = lasso.c errors.c

if WSF_ENABLED
SYMBOLS_ARGS = -wsf
endif

types.c:
	$(PYTHON) $(srcdir)/extract_types.py $(srcdir) $(SYMBOLS_ARGS)

symbols.sym:
	$(PYTHON) $(srcdir)/extract_symbols.py $(srcdir) $(SYMBOLS_ARGS) > symbols.sym

clean-local:
	-rm types.c symbols.sym

EXTRA_DIST = extract_types.py extract_symbols.py

if WSF_ENABLED
WSF_LIB_FILE = $(top_builddir)/lasso/id-wsf/liblasso-id-wsf.la
endif

if MINGW
liblasso_la_LIBADD = \
	$(top_builddir)/lasso/xml/liblasso-xml.la \
	$(top_builddir)/lasso/id-ff/liblasso-id-ff.la \
	$(WSF_LIB_FILE) \
	$(LASSO_LIBS) \
	lasso.rc.lo
# Just make damn sure the ABI stays the same between
# upgrades.
# Obviously if you don't, fixing the situation up again can be painful. 
liblasso_la_LDFLAGS = -no-undefined -version-info @LASSO_VERSION_INFO@ \
                      -Wl,--add-stdcall-alias 
else
liblasso_la_LIBADD = \
	$(top_builddir)/lasso/xml/liblasso-xml.la \
	$(top_builddir)/lasso/id-ff/liblasso-id-ff.la \
	$(WSF_LIB_FILE) \
	$(LASSO_LIBS)
# Just make damn sure the ABI stays the same between
# upgrades.
# Obviously if you don't, fixing the situation up again can be painful. 
liblasso_la_LDFLAGS = -no-undefined -version-info @LASSO_VERSION_INFO@ \
	-export-symbols symbols.sym
endif

.PHONY: types.c symbols.sym
