summaryrefslogtreecommitdiff
path: root/Makefile-giscanner.am
blob: 0ca98f6c2e64abdfbde2184b685cf0cad35df995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
## Process this file with automake to produce Makefile.in

BUILT_SOURCES += 		\
	scannerparser.c		\
	scannerparser.h 	\
	scannerlexer.c 		\
	scannerlexer.h

AM_YFLAGS = -d -t

# Why do I have to do this automake?
scannerlexer.h: scannerlexer.c

noinst_LTLIBRARIES += libgiscanner.la

libgiscanner_la_SOURCES = \
	giscanner/sourcescanner.c				\
	giscanner/sourcescanner.h				\
	giscanner/scannerlexer.l				\
	giscanner/scannerparser.y				\
	giscanner/grealpath.h
libgiscanner_la_CPPFLAGS = -I$(top_srcdir)/girepository -I$(top_srcdir)/giscanner
libgiscanner_la_LIBADD = $(GOBJECT_LIBS)
libgiscanner_la_CFLAGS = $(GOBJECT_CFLAGS)

# Python module
pkgpyexecdir = $(pkglibdir)/giscanner
pkgpyexec_LTLIBRARIES = _giscanner.la
pkgpyexec_PYTHON =			\
	giscanner/__init__.py		\
	giscanner/annotationmain.py	\
	giscanner/annotationparser.py	\
	giscanner/ast.py		\
	giscanner/cachestore.py		\
	giscanner/codegen.py		\
	giscanner/dumper.py		\
	giscanner/introspectablepass.py	\
	giscanner/girparser.py		\
	giscanner/girwriter.py		\
	giscanner/gdumpparser.py 	\
	giscanner/libtoolimporter.py	\
	giscanner/odict.py		\
	giscanner/maintransformer.py	\
	giscanner/message.py		\
	giscanner/shlibs.py		\
	giscanner/scannermain.py	\
	giscanner/sourcescanner.py	\
	giscanner/testcodegen.py	\
	giscanner/transformer.py	\
	giscanner/utils.py		\
	giscanner/xmlwriter.py

_giscanner_la_CFLAGS = \
	$(PYTHON_INCLUDES) \
	$(GOBJECT_CFLAGS) \
	-I$(top_srcdir)/giscanner
_giscanner_la_LIBADD = libgiscanner.la $(GOBJECT_LIBS)

_giscanner_la_LDFLAGS = \
	-module -avoid-version -export-symbols-regex init_giscanner

if OS_WIN32
# Yuck. Probably there is a way to get this from Python, but I don't
# know how. Use -Wl to avoid libtool crack.
_giscanner_la_LDFLAGS += -Wl,$(pyexecdir)/../../libs/libpython25.a -no-undefined
endif

_giscanner_la_SOURCES = giscanner/giscannermodule.c

if OS_WIN32
BUILT_SOURCES += _giscanner.pyd
CLEANFILES += _giscanner.pyd

_giscanner.pyd: _giscanner.la
	cp .libs/_giscanner.dll $@

install-exec-hook:
	mv $(pkgpyexecdir)/_giscanner.dll $(pkgpyexecdir)/_giscanner.pyd
	rm $(pkgpyexecdir)/_giscanner.dll.a
	rm $(pkgpyexecdir)/_giscanner.la
endif