-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
113 lines (84 loc) · 2.96 KB
/
Makefile
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
ifneq ($(shell uname -m),x86_64)
$(error Building on other architectures than x84_64 not yet supported)
endif
MYDIR := $(dir $(firstword $(MAKEFILE_LIST)))
TOP := $(realpath $(MYDIR))
include $(MYDIR)/tools/paths.mk
PROJECT_NAME := $(notdir $(TOP))
PROJECT_NAME_LOWERCASE := $(shell echo $(PROJECT_NAME) | tr A-Z a-z)
EXTRACT_VERSION := $(TOP)/tools/extract_project_version.xsl
VERSION := $(shell $(XSLTPROC) $(EXTRACT_VERSION) pom.xml)
PROJECT_JAR := target/$(PROJECT_NAME)-$(VERSION).jar
PROJECT_BIN := target/$(PROJECT_NAME)-$(VERSION)-bin.zip
GH_PAGES := $(TOP)/gh-pages
NATIVES := native/Linux-amd64/libdevslashlirc.so native/Linux-i386/libdevslashlirc.so native/Linux-arm
LIBS := target/libdevslashlirc.so $(NATIVES)
DOCS := target/api-doc/index.html target/site/apidocs/index.html
all: $(LIBS) $(PROJECT_BIN) $(DOCS)
target native native/Linux-amd64 native/Linux-i386 native/Linux-arm:
mkdir -p $@
test: lib
(cd src/main/c++ && make)
(cd src/test/c++ && make test)
$(PROJECT_JAR) $(PROJECT_BIN): $(LIBS)
mvn install -Dmaven.test.skip=true
$(PROJECT_JAR)-test:
mvn install -Dmaven.test.skip=false
release: push gh-pages tag deploy
JAVAH_MARKER = target/classes/org/harctoolbox/devslashlirc/Mode2LircDevice.class
$(JAVAH_MARKER):
mvn compile
lib: target/libdevslashlirc.so
target/libdevslashlirc.so: native/Linux-amd64/libdevslashlirc.so
cp $< $@
native/Linux-amd64/libdevslashlirc.so: $(JAVAH_MARKER) | native/Linux-amd64
(cd src/main/c++ && make clean)
(cd src/main/c++ && make)
cp src/main/c++/libdevslashlirc.so $@
native/Linux-i386/libdevslashlirc.so: $(JAVAH_MARKER) | native/Linux-i386
(cd src/main/c++ && make clean)
(cd src/main/c++ && make M=-m32)
cp src/main/c++/libdevslashlirc.so $@
# Not yet working
# Until cross compiling is working, this is a working procedure:
# make all
# Log in RPi, cd to src/main/c++ there
# make clean all
# Then
# cp target/libdevslashlirc.so native/Linux-arm
#native/Linux-arm/libdevslashlirc.so: $(JAVAH_MARKER) | native/Linux-arm
# (cd src/main/c++ && make clean)
# (cd src/main/c++ && make CXX=arm-linux-gnu-c++)
# cp src/main/c++/libdevslashlirc.so $@
release: push gh-pages tag deploy
version:
@echo $(VERSION)
setversion:
mvn versions:set -DnewVersion=$(NEWVERSION)
git commit -S -m "Set version to $(NEWVERSION)" pom.xml
deploy:
mvn deploy -P release
target/api-doc/index.html: | target
doxygen
target/site/apidocs/index.html:
mvn javadoc:javadoc
push:
git push
gh-pages: target/api-doc/index.html target/site/apidocs/index.html
tools/update-gh-pages.sh
doc: target/api-doc/index.html target/site/apidocs/index.html
$(foreach f,$^,$(shell $(BROWSE) $(f)))
tag:
git checkout master
git status
git tag -s -a Version-$(VERSION) -m "Tagging Version-$(VERSION)"
git push origin Version-$(VERSION)
clean:
mvn clean
(cd src/main/c++ && make clean)
(cd src/test/c++ && make clean)
rm -f hs_err*.log doxygen_sqlite3.db
rm -r -f native
rm -rf gh-pages
.NOTPARALLEL:
.PHONY: clean $(PROJECT_JAR)-test release