-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathrules
More file actions
executable file
·114 lines (100 loc) · 3.21 KB
/
Copy pathrules
File metadata and controls
executable file
·114 lines (100 loc) · 3.21 KB
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
#!/usr/bin/make -f
# -*- makefile -*-
# OpenModelica debian/rules that uses debhelper.
# Based on a sample file with GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
# since we updated the copyright in .g files we need to set UTF8 as otherwise ANTLR parser barks on {\"o}
export LC_ALL = C.UTF-8
DEST = $(CURDIR)/debian/tmp
BUILD = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)
CC = clang
CXX = clang++
ifeq (arm-linux-gnueabihf,$(DEB_HOST_GNU_TYPE))
CPP_RUNTIME = OFF
else
CPP_RUNTIME = ON
endif
OPTFLAG = -Os
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
OPTFLAG = -O0
endif
PARALLEL = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
ifneq (,$(PARALLEL))
BUILDFLAGS = --parallel $(PARALLEL)
endif
build: build-stamp
build-arch: build
build-indep: build
build-stamp:
dh_testdir
# No git in the tarball; REVISION is the same version in dpkg's spelling.
test -e OMVERSION.txt || test ! -e REVISION || sed -e 's,^,v,' -e 'y,~,-,' REVISION > OMVERSION.txt
cmake -S . -B $(BUILD) -Wno-dev \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER="$(CC)" \
-DCMAKE_CXX_COMPILER="$(CXX)" \
-DCMAKE_C_FLAGS_RELEASE="$(OPTFLAG) -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELEASE="$(OPTFLAG) -DNDEBUG" \
-DOM_USE_CCACHE=OFF \
-DOM_ENABLE_TESTSUITE=OFF \
-DOM_ENABLE_DOCS=OFF \
-DOM_ENABLE_GUI_CLIENTS=ON \
-DOM_QT_MAJOR_VERSION=6 \
-DOM_ENABLE_OMSIMULATOR=ON \
-DOM_OMC_ENABLE_CPP_RUNTIME=$(CPP_RUNTIME) \
-DOM_OMOPTIM_ENABLE=OFF \
-DOM_RUST_RESULT_READERS=ON \
-DOM_RUST_RESULT_WRITERS=ON \
-DOM_ENABLE_RUST_SIM_RUNTIME=ON
cmake --build $(BUILD) $(BUILDFLAGS)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
rm -rf $(BUILD)
test ! -e REVISION || rm -f OMVERSION.txt
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs -popenmodelica -Pdebian/tmp
DESTDIR=$(DEST) cmake --install $(BUILD)
# The cmake omlibrary target would download with /usr/bin/omc, not this omc.
rm -rf $(BUILD)/omlibrary
mkdir -p $(BUILD)/omlibrary/.openmodelica/libraries
cp libraries/install-index.json $(BUILD)/omlibrary/.openmodelica/libraries/index.json
cd $(BUILD)/omlibrary && $(DEST)/usr/bin/omc $(CURDIR)/libraries/install-index.mos
mkdir -p $(DEST)/usr/share/omlibrary/cache
cp libraries/install-index.json $(DEST)/usr/share/omlibrary/cache/index.json
cp $(BUILD)/omlibrary/.openmodelica/cache/* $(DEST)/usr/share/omlibrary/cache/
# No language server is published for armhf, so the directory may be absent.
mkdir -p $(DEST)/usr/share/omedit/ls
# We add our own Debian-specific copyright file
rm -f $(DEST)/usr/share/doc/omc/COPYING
dh_install
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_installexamples
dh_missing --list-missing
dh_installmenu
dh_installmime
dh_link
dh_strip
dh_fixperms
dh_installdeb
dh_makeshlibs -V
dh_shlibdeps -l/usr/lib/$(DEB_HOST_MULTIARCH)/omc -Lomc -- --ignore-missing-info
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install