OpenCores
URL https://opencores.org/ocsvn/amber/amber/trunk

Subversion Repositories amber

[/] [amber/] [trunk/] [sw/] [dhry/] [Makefile] - Blame information for rev 36

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 31 csantifort
 
2
SRC = dhry.c dhry_2.c start.S
3
TGT = dhry
4
LDS = sections.lds
5
USE_MINI_LIBC = 1
6
 
7
LIBC_OBJ         = ../mini-libc/printf.o ../mini-libc/libc_asm.o ../mini-libc/memcpy.o
8
DEP             += ../include/amber_registers.h ../mini-libc/stdio.h
9
TOOLSPATH        = ../tools
10
AMBER_CROSSTOOL ?= amber-crosstool-not-defined
11
 
12
  AS = $(AMBER_CROSSTOOL)-as
13
  CC = $(AMBER_CROSSTOOL)-gcc
14
 CXX = $(AMBER_CROSSTOOL)-g++
15
  AR = $(AMBER_CROSSTOOL)-ar
16
  LD = $(AMBER_CROSSTOOL)-ld
17
  DS = $(AMBER_CROSSTOOL)-objdump
18
  OC = $(AMBER_CROSSTOOL)-objcopy
19
 ELF = $(TOOLSPATH)/amber-elfsplitter
20 36 csantifort
 BMF32  = ../tools/amber-memparams32.sh
21
 BMF128 = ../tools/amber-memparams128.sh
22 31 csantifort
 
23 36 csantifort
 MMP32  = $(addsuffix _memparams32.v, $(basename $(TGT)))
24
 MMP128 = $(addsuffix _memparams128.v, $(basename $(TGT)))
25 31 csantifort
 MEM = $(addsuffix .mem, $(basename $(TGT)))
26
 DIS = $(addsuffix .dis, $(basename $(TGT)))
27
 
28
ifdef USE_MINI_LIBC
29
 OBJ = $(addsuffix .o,   $(basename $(SRC))) $(LIBC_OBJ)
30
else
31
 OBJ = $(addsuffix .o,   $(basename $(SRC)))
32
endif
33
 
34
 
35
ifdef LDS
36
    TLDS = -T $(LDS)
37
else
38
    TLDS =
39
endif
40
 
41
ifndef TGT
42
    TGT = aout.elf
43
endif
44
 
45
ifdef MIN_SIZE
46
    # optimize for size
47
    OPTIMIZE = -Os
48
else
49
    # optimize for speed
50
    OPTIMIZE = -O3
51
endif
52
 
53
 MAP = $(addsuffix .map, $(basename $(TGT)))
54
 
55
 ASFLAGS = -I../include
56
  CFLAGS = -c $(OPTIMIZE) -march=armv2a -mno-thumb-interwork -ffreestanding -I../include
57
 DSFLAGS = -C -S -EL
58
 LDFLAGS = -Bstatic -Map $(MAP) --strip-debug --fix-v4bx
59
 
60
 
61
ifdef USE_MINI_LIBC
62
debug:  mini-libc $(ELF) $(MMP) $(DIS)
63
else
64
debug:  $(ELF) $(MMP) $(DIS)
65
endif
66
 
67
$(MMP): $(MEM)
68 36 csantifort
        $(BMF32) $(MEM) $(MMP32)
69 31 csantifort
 
70
$(MEM): $(TGT)
71
        $(ELF) $(TGT) > $(MEM)
72
 
73
$(TGT): $(OBJ)
74
        $(LD) $(LDFLAGS) -o $(TGT) $(TLDS) $(OBJ)
75
        $(OC) -R .comment -R .note $(TGT)
76
 
77
$(OBJ): $(DEP)
78
 
79
mini-libc:
80
        $(MAKE) -s -C ../mini-libc MIN_SIZE=1
81
 
82
$(ELF):
83
        $(MAKE) -C $(TOOLSPATH)
84
 
85
$(DIS): $(TGT)
86
        $(DS) $(DSFLAGS) $^ > $@
87
 
88
clean:
89
        @rm -rfv *.o *.elf *.dis *.map *.mem *.v $(MMP) dhry
90
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.