-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (75 loc) · 1.76 KB
/
Makefile
File metadata and controls
83 lines (75 loc) · 1.76 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
#########################################################
# Make file for dStrings #
#########################################################
# The following flag defines if static or dynamic library
# for serial_comms. Set a value for true, leave empty for
# false.
DYNAMIC = true
# Use standard variables to define compile and link flags
#
TL=tools
TSV=test/test_vectors
TST=test/test_generic_binary_trees
TSD=test/test_generic_binary_trees_with_data
TSB=test/test_base_64
TSS=test/test_stack
SOURCE=.
ACC=gprbuild
TO=$(TL).gpr
TTV=$(TSV).gpr
TTT=$(TST).gpr
TTD=$(TSD).gpr
TTB=$(TSB).gpr
TTS=$(TSS).gpr
HOST_TYPE := $(shell uname -m)
OS_TYPE := $(shell uname -o)
ifeq ($(HOST_TYPE),amd)
TARGET=sparc
else ifeq ($(HOST_TYPE),x86_64)
ifeq ($(OS_TYPE),Cygwin)
TARGET=win
else
TARGET=amd64
endif
else ifeq ($(HOST_TYPE),x86)
TARGET=x86
else ifeq ($(HOST_TYPE),i686)
TARGET=x86
else ifeq ($(HOST_TYPE),arm)
TARGET=pi
else ifeq ($(HOST_TYPE),armv7l)
TARGET=pi
else ifeq ($(HOST_TYPE),aarch64)
TARGET=pi64
endif
TD=obj_$(TARGET)
BIN=/usr/local/bin
ETC=/usr/local/etc
LIB=/usr/local/lib
ifeq ("$1.",".")
FLAGS=-Xhware=$(TARGET)
else
FLAGS=-Xhware=$(TARGET) $1
endif
ifeq ($(OS_TYPE),Cygwin)
FLAGS+=-cargs -I/usr/include/sys
endif
tools:
echo "Building for $(HOST_TYPE) at $(TD):"
$(ACC) -P $(TO) $(FLAGS)
tests:
echo "Building for $(HOST_TYPE) at $(TD):"
$(ACC) -P $(TTV) $(FLAGS)
$(ACC) -P $(TTT) $(FLAGS)
$(ACC) -P $(TTD) $(FLAGS)
$(ACC) -P $(TTB) $(FLAGS)
$(ACC) -P $(TTS) $(FLAGS)
# Define the target "all"
all:
tools
tests
# Clean up to force the next compilation to be everything
clean:
rm -f $(TD)/*.o $(TD)/*.ali $(TD)/*.a
dist-clean: distclean
distclean: clean