-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
65 lines (51 loc) · 1.95 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
## Copyright 2023 University of Adelaide
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
## http://www.apache.org/licenses/LICENSE-2.0
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
LDLIBS += -ldl
# compile with assemblyline if possible
LIBS_AL = $(shell which pkg-config >/dev/null && pkg-config --exists assemblyline >/dev/null && echo 1 || echo 0)
ifeq ($(LIBS_AL), 1)
LDLIBS += $(shell pkg-config --libs assemblyline)
CPPFLAGS += $(shell pkg-config --cflags assemblyline) -DUSE_ASSEMBLYLINE
endif
## Enable debug with make DEBUG=1
DEBUG ?= 0
ifneq ($(DEBUG), 0)
CFLAGS += -g -DENABLE_DEBUG
endif
# use make -B DEBUG=1 CFLAGS='-g' for debug output and better debugging experience
.PHONY: all check clean
.PRECIOUS: libmeasuresuite.so libmeasuresuite.a ms
all: lib/libmeasuresuite.so lib/libmeasuresuite.a ms
lib/libmeasuresuite.a lib/libmeasuresuite.so:
$(MAKE) -C lib $(subst lib/,,$(@))
ms: bin/arg_parse.c bin/ms.c lib/libmeasuresuite.a
$(CC) $(CFLAGS) -I./lib/src/include $(^) $(CPPFLAGS) $(LDLIBS) -o $(@)
publish: clean
tsc --emitDeclarationOnly -p ./ts/
npm install
npm run build
cp Readme.md ./ts/dist
@echo "If you've updated the versions (npm version minor), run 'npm publish' now"
clean:
rm -rf ms \
ts/coverage \
ts/dist \
build
$(MAKE) -C lib $(@)
check: ms
$(MAKE) -C lib test
@./ms \
-s add_two_numbers \
./lib/test/test_data/add_two_numbers.asm \
./lib/test/test_data/add_two_numbers.bin \
./lib/test/test_data/add_two_numbers.so \
./lib/test/test_data/add_two_numbers.o && \
echo -e "\r\033[32m OK\033[0m "