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

Subversion Repositories light52

[/] [light52/] [trunk/] [test/] [include/] [common.mk] - Blame information for rev 16

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

Line No. Rev Author Line
1 3 ja_rd
#-- common.mk - Makefile include common to all test and demo programs ----------
2
#
3
# This make include file should be included in a project makefile *after* the
4
# project configuration variables have been defined. See the Dhrystone makefile
5
# for an usage example.
6
 
7
#-- Toolchain executables ------------------------------------------------------
8
 
9
# FIXME only tested in Win32/Cygwin host. This may not work in a vanilla Win32.
10
 
11
AS =
12
CC = SDCC
13
LD = SDCC
14
RM = rm
15
CP = cp
16
 
17
#-- Give default values to the compiler, linker and assembler flags ------------
18
 
19
ifndef LFLAGS
20
LFLAGS = -o $(OBJDIR)/
21
endif
22
ifndef CFLAGS
23
CFLAGS = -o $(OBJDIR)/
24
endif
25
ifndef AFLAGS
26
AFLAGS = -c
27
endif
28
 
29
 
30
#-- A bit of 'make magic' to simplify the rules --------------------------------
31
 
32
# Add all the source directories to the VPATH...
33
VPATH := $(dir $(SRC))
34
# ...and build the OBJS list from the list of sources
35
OBJS := $(patsubst %.c, $(OBJDIR)/%.rel, $(notdir $(SRC)))
36
 
37
 
38
#-- Targets & rules ------------------------------------------------------------
39
 
40
# Compile C sources into relocatable object files
41
$(OBJDIR)/%.rel : %.c
42
        @echo Compiling $< ...
43
        $(CC) $(CFLAGS) -c $<
44
 
45
# Build executable file and move it to the bin directory
46
$(BINDIR)/$(BIN): $(OBJS)
47
        @echo Building executable file $@ ...
48
        $(LD) $(OBJS) $(LFLAGS)
49
        $(CP) $(OBJDIR)/*.ihx $(BINDIR)/$(BIN)
50
 
51
# Root target
52
all: $(BINDIR)/$(BIN) package
53
        @echo Done
54
 
55
 
56
#-- Targets that build the synthesizable vhdl ----------------------------------
57
 
58
#-- Create VHDL package with object code and synthesis parameters
59
package: $(BINDIR)/$(BIN)
60
        @echo Building object code VHDL package...
61
        @python $(BRPATH)/src/build_rom.py \
62
                -f $(BINDIR)/$(BIN)  \
63
                -v $(BRPATH)/templates/obj_code_pkg_template.vhdl \
64
                --xcode $(XCODE_SIZE) --xdata $(XDATA_SIZE) -n $(PROJ_NAME) \
65
                -o $(VHDL_TB_PATH)/obj_code_pkg.vhdl
66
 
67
#-- And now the usual housekeeping stuff ---------------------------------------
68
 
69
.PHONY: clean
70
 
71
clean:
72
        -$(RM) $(OBJDIR)/*.* $(BINDIR)/*.* $(VHDL_TB_PATH)/obj_code_pkg.vhdl

powered by: WebSVN 2.1.0

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