Mercurial > hg > CbC > CbC_xv6
annotate src/makefile.inc @ 114:f3ebb813d0bf
add TaskManager.h
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 02 Dec 2019 11:25:51 +0900 |
parents | 58ec26c64601 |
children |
rev | line source |
---|---|
0 | 1 # Cross-compiling (e.g., on Mac OS X, install arm-none-eabi-gcc with MacPorts) |
11 | 2 |
6 | 3 CROSSCOMPILE := arm-linux-gnu- |
0 | 4 |
20 | 5 CPU = armv8 |
23
ee58360d0e99
commnet out cbclang
Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
6 #CC = /usr/local/cbclang/bin/clang |
0 | 7 AS = $(CROSSCOMPILE)as |
8 LD = $(CROSSCOMPILE)ld | |
9 OBJCOPY = $(CROSSCOMPILE)objcopy | |
10 OBJDUMP = $(CROSSCOMPILE)objdump | |
11 | |
20 | 12 # CFLAGS = -march=${CPU} -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -Werror -I. -g -O0 |
13 CFLAGS = -target ${CPU}-none-eabi -I /net/open/Linux/arm/gcc-arm-none-eabi-7-2017-q4-major/arm-none-eabi/include/ /net/open/Linux/arm/gcc-arm-none-eabi-7-2017-q4-major/lib/gcc/arm-none-eabi/7.2.1/include-fixed/ -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -I. -g -O0 | |
0 | 14 LDFLAGS = -L. |
20 | 15 # ASFLAGS = -march=${CPU} |
16 ASFLAGS = -target ${CPU}-none-eabi | |
0 | 17 |
11 | 18 #LIBGCC = $(shell $(gcc) -print-libgcc-file-name) |
19 LIBGCC = /net/open/Linux/arm/gcc-arm-none-eabi-7-2017-q4-major/lib/gcc/arm-none-eabi/7.2.1/libgcc.a | |
0 | 20 |
21 # host compiler | |
23
ee58360d0e99
commnet out cbclang
Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
22 HOSTCC_preferred = gcc |
ee58360d0e99
commnet out cbclang
Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
20
diff
changeset
|
23 #HOSTCC_preferred = /usr/local/cbclang/bin/clang |
0 | 24 define get_hostcc |
25 $(if $(shell which $(HOSTCC_preferred)),$(HOSTCC_preferred),"cc") | |
26 endef | |
27 HOSTCC := $(call get_hostcc) | |
28 | |
29 # general rules | |
30 quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1)) | |
31 | |
32 LINK_BIN = $(call quiet-command,$(LD) $(LDFLAGS) \ | |
33 -T $(1) -o $(2) $(3) $(LIBS) -b binary $(4), " LINK $(TARGET_DIR)$@") | |
34 | |
35 LINK_INIT = $(call quiet-command,$(LD) $(LDFLAGS) \ | |
36 $(1) -o $@.out $<, " LINK $(TARGET_DIR)$@") | |
37 OBJCOPY_INIT = $(call quiet-command,$(OBJCOPY) \ | |
38 -S -O binary --prefix-symbols="_binary_$@" $@.out $@, " OBJCOPY $(TARGET_DIR)$@") | |
39 | |
40 build-directory = $(shell mkdir -p build build/device build/lib) | |
41 | |
42 build/%.o: %.c | |
43 $(call build-directory) | |
44 $(call quiet-command,$(CC) $(CFLAGS) \ | |
45 -c -o $@ $<," CC $(TARGET_DIR)$@") | |
46 | |
48 | 47 build/%.o: %.cbc |
48 $(call build-directory) | |
49 $(call quiet-command,$(CC) $(CFLAGS) \ | |
50 -c -o $@ $<," CC $(TARGET_DIR)$@") | |
51 | |
0 | 52 AS_WITH = $(call quiet-command,$(CC) $(ASFLAGS) \ |
53 $(1) -c -o $@ $<," AS $(TARGET_DIR)$@") | |
54 | |
55 build/%.o: %.S | |
56 $(call build-directory) | |
57 $(call AS_WITH, ) |