forked from rdfa/librdfa
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.in
131 lines (110 loc) · 4.14 KB
/
Makefile.in
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# The top-level Makefile that is used to build
# setup variables from configure
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@
# pkg-config dirs
pkgconfigdir = @libdir@/pkgconfig
# Python build control
BUILD_FOR_PYTHON=@BUILD_FOR_PYTHON@
PY_DEFAULT := @PY_DEFAULT@
PY_VERSIONS := $(sort @PY_VERSIONS@ $(PY_DEFAULT))
VERSION = @VERSION@
SUBDIRS := c
ifeq ($(BUILD_FOR_PYTHON),yes)
SUBDIRS += python
endif
SUBDIRS += tests
ifdef PRINT_DIRECTORIES
MAKE_CMD = $(MAKE) -j -l 5.0
MAKE_DIR = $(MAKE_CMD) -C $(dir)
else
MAKE_CMD = $(MAKE) -j -l 5.0 --no-print-directory -s
MAKE_DIR = $(MAKE_CMD) -C $(dir)
endif
LIBS_DIR = @RDFADIR@/libs
.PHONY: all verbose clean test docs install-python
all: docs
@$(foreach dir,$(SUBDIRS),$(MAKE_DIR) \
build-objects build-libraries \
PY_VERSIONS="$(PY_VERSIONS)" \
PY_DEFAULT="$(PY_DEFAULT)" &&) true
@$(foreach dir,$(SUBDIRS),$(MAKE_DIR) \
build-executables &&) true
clean:
@$(foreach dir,$(SUBDIRS),MAKE_CLEAN_ACTIVE=true $(MAKE_DIR) clean &&) true
@rm -rf libs/*
@rm -rf installers/packages
@echo "Removed all objects and libraries."
tests: all
LD_LIBRARY_PATH=@RDFADIR@/libs tests/dist/curies
LD_LIBRARY_PATH=@RDFADIR@/libs tests/dist/rdfa2n3 tests/testsuite/0001.xhtml
docs:
@$(MAKE_DIR) docs
install-librdfa:
@echo "Installing librdfa libraries to $(DESTDIR)$(libdir) ..."
@install -d $(DESTDIR)$(libdir)
@install -m 644 $(LIBS_DIR)/librdfa.so $(DESTDIR)$(libdir)/librdfa.so.$(VERSION)
@ln -sf librdfa.so.$(VERSION) $(DESTDIR)$(libdir)/librdfa.so
install-librdfa-dev:
@echo "Installing librdfa development support to $(DESTDIR)$(libdir) ..."
@install -d $(DESTDIR)$(libdir)
@install -d $(DESTDIR)$(includedir)
@install -d $(DESTDIR)$(pkgconfigdir)
@install -m 644 $(LIBS_DIR)/librdfa.a $(DESTDIR)$(libdir)/librdfa.a
@install -m 644 c/rdfa.h $(DESTDIR)$(includedir)
@install -m 644 c/rdfa_utils.h $(DESTDIR)$(includedir)
@install -m 644 librdfa.pc $(DESTDIR)$(pkgconfigdir)
# FIXME: this should install to site-packages for 2.5 and dist-packages for 2.6
ifeq ($(BUILD_FOR_PYTHON),yes)
install-python%:
echo "Installing python extensions to $(DESTDIR)$(libdir)/python$*/site-packages ..."
install -d $(DESTDIR)$(libdir)/python$*/site-packages
install -m 644 python/dist/rdfa.py $(DESTDIR)$(libdir)/python$*/site-packages
install -m 644 python/dist/python$*-rdfa.so $(DESTDIR)$(libdir)/python$*/site-packages/_rdfa.so
install-python: $(PY_VERSIONS:%=install-python%)
else
install-python:
endif
packages:
@echo "Generating Debian packages..."
@ln -sf installers/debian debian
@dpkg-buildpackage -us -uc -rfakeroot
@mkdir -p installers/packages
@mv ../*rdfa*@RELEASE@*deb installers/packages
@echo "Generating RPM packages..."
@cd installers/packages && fakeroot alien --to-rpm -k --scripts *deb
@echo "Generating TGZ packages..."
@cd installers/packages && fakeroot alien --to-tgz -k --scripts *deb
@echo "Generating Solaris packages..."
@cd installers/packages && fakeroot alien --to-pkg -k --scripts *deb
@echo "Generating Stampede packages..."
@cd installers/packages && fakeroot alien --to-slp -k --scripts *deb
ifeq (@OS@,mingw32)
install-windows:
@echo "Generating Windows ZIP release..."
@mkdir -p installers/librdfa-windows-@RELEASE@
@cp c/rdfa.h installers/librdfa-windows-@RELEASE@
@cp c/rdfa_utils.h installers/librdfa-windows-@RELEASE@
@cp libs/rdfa.dll installers/librdfa-windows-@RELEASE@
@cp libs/rdfa.lib installers/librdfa-windows-@RELEASE@
@cd installers && zip -r librdfa-@VERSION@-windows-@[email protected] \
librdfa-windows-@RELEASE@
@rm -rf installers/librdfa-windows-@RELEASE@
endif
ifeq (@OS@,macos)
install-macos:
@echo "Generating Mac OS X ZIP release..."
@mkdir -p installers/librdfa-macos-@RELEASE@
@cp c/rdfa.h installers/librdfa-macos-@RELEASE@
@cp c/rdfa_utils.h installers/librdfa-macos-@RELEASE@
@cp libs/librdfa.dylib installers/librdfa-macos-@RELEASE@
@cp libs/librdfa.a installers/librdfa-macos-@RELEASE@
@cd installers && zip -r librdfa-@VERSION@-macos-@[email protected] \
librdfa-macos-@RELEASE@
@rm -rf installers/librdfa-macos-@RELEASE@
endif
install: install-librdfa install-librdfa-dev install-python
verbose:
PRINT_DIRECTORIES=true $(MAKE) all