-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
54 lines (39 loc) · 1 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
# verbose mode (print commands) on V=1 or VERBOSE=1
Q = $(if $(filter 1,$(V) $(VERBOSE)),,@)
LIBDIR = lib
TESTDIR = test
EXAMPLESDIR = examples
TESTDIR = test
# Define nul output
VOID = /dev/null
# default target (when runing `make` with no argument)
lib-release:
.PHONY: all
all: lib examples testsbuild
.PHONY: lib lib-release
lib lib-release:
$(Q)$(MAKE) -C $(LIBDIR) $@
## examples: build all examples in `examples/` directory
.PHONY: examples
examples:
$(Q)$(MAKE) -C $(EXAMPLESDIR) all
## tests: build all tests in `test/` directory
.PHONY: testsbuild
testsbuild:
$(Q)$(MAKE) -C $(TESTDIR) all
.PHONY: test
test:
$(Q)$(MAKE) -C $(TESTDIR) test
.PHONY: coverage
coverage:
$(Q)$(MAKE) -C $(TESTDIR) coverage
.PHONY: sparcbuild
sparcbuild: clean
sparc-elf-gcc -v
CC=sparc-elf-gcc CFLAGS="-mv8 -Wno-long-long \
-Wno-missing-field-initializers" $(MAKE) all
.PHONY: clean
clean:
$(Q)$(MAKE) -C $(EXAMPLESDIR) $@ > $(VOID)
$(Q)$(MAKE) -C $(TESTDIR) $@ > $(VOID)
@echo Cleaning completed