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

Subversion Repositories amber

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

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
 BMF = $(TOOLSPATH)/amber-memparams.sh
21
 
22
 MMP = $(addsuffix _memparams.v, $(basename $(TGT)))
23
 MEM = $(addsuffix .mem, $(basename $(TGT)))
24
 DIS = $(addsuffix .dis, $(basename $(TGT)))
25
 
26
ifdef USE_MINI_LIBC
27
 OBJ = $(addsuffix .o,   $(basename $(SRC))) $(LIBC_OBJ)
28
else
29
 OBJ = $(addsuffix .o,   $(basename $(SRC)))
30
endif
31
 
32
 
33
ifdef LDS
34
    TLDS = -T $(LDS)
35
else
36
    TLDS =
37
endif
38
 
39
ifndef TGT
40
    TGT = aout.elf
41
endif
42
 
43
ifdef MIN_SIZE
44
    # optimize for size
45
    OPTIMIZE = -Os
46
else
47
    # optimize for speed
48
    OPTIMIZE = -O3
49
endif
50
 
51
 MAP = $(addsuffix .map, $(basename $(TGT)))
52
 
53
 ASFLAGS = -I../include
54
  CFLAGS = -c $(OPTIMIZE) -march=armv2a -mno-thumb-interwork -ffreestanding -I../include
55
 DSFLAGS = -C -S -EL
56
 LDFLAGS = -Bstatic -Map $(MAP) --strip-debug --fix-v4bx
57
 
58
 
59
ifdef USE_MINI_LIBC
60
debug:  mini-libc $(ELF) $(MMP) $(DIS)
61
else
62
debug:  $(ELF) $(MMP) $(DIS)
63
endif
64
 
65
$(MMP): $(MEM)
66
        $(BMF) $(MEM) $(MMP)
67
 
68
$(MEM): $(TGT)
69
        $(ELF) $(TGT) > $(MEM)
70
 
71
$(TGT): $(OBJ)
72
        $(LD) $(LDFLAGS) -o $(TGT) $(TLDS) $(OBJ)
73
        $(OC) -R .comment -R .note $(TGT)
74
 
75
$(OBJ): $(DEP)
76
 
77
mini-libc:
78
        $(MAKE) -s -C ../mini-libc MIN_SIZE=1
79
 
80
$(ELF):
81
        $(MAKE) -C $(TOOLSPATH)
82
 
83
$(DIS): $(TGT)
84
        $(DS) $(DSFLAGS) $^ > $@
85
 
86
clean:
87
        @rm -rfv *.o *.elf *.dis *.map *.mem *.v $(MMP) dhry
88
 

powered by: WebSVN 2.1.0

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