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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [bench/] [cpp/] [Makefile] - Blame information for rev 209

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dgisselq
################################################################################
2 209 dgisselq
##
3
## Filename:    Makefile
4
##
5
## Project:     Zip CPU -- a small, lightweight, RISC CPU soft core
6
##
7
## Purpose:     To direct and simplify the build of a variety of simple test
8
##              programs which will use one (or both) of the ZipCPU simulators.
9
##
10
## Targets include:
11
##
12
##              helloworld
13
##
14
##
15
##
16
## Creator:     Dan Gisselquist, Ph.D.
17
##              Gisselquist Technology, LLC
18
##
19 2 dgisselq
################################################################################
20 209 dgisselq
##
21
## Copyright (C) 2017-2019, Gisselquist Technology, LLC
22
##
23
## This program is free software (firmware): you can redistribute it and/or
24
## modify it under the terms of  the GNU General Public License as published
25
## by the Free Software Foundation, either version 3 of the License, or (at
26
## your option) any later version.
27
##
28
## This program is distributed in the hope that it will be useful, but WITHOUT
29
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
30
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
31
## for more details.
32
##
33
## You should have received a copy of the GNU General Public License along
34
## with this program.  (It's in the $(ROOT)/doc directory.  Run make with no
35
## target there if the PDF file isn't present.)  If not, see
36
##  for a copy.
37
##
38
## License:     GPL, v3, as defined and found on www.gnu.org,
39
##              http://www.gnu.org/licenses/gpl.html
40
##
41
##
42 2 dgisselq
################################################################################
43 209 dgisselq
##
44
##
45 202 dgisselq
.PHONY: all
46
all: helloworld
47 2 dgisselq
 
48 202 dgisselq
CC      := zip-gcc
49
OBJDUMP := zip-objdump
50
OBJDIR := obj-zip
51
CFLAGS := -O3
52
LIBD   := ../../sw/install/cross-tools/zip/lib
53
LIBS   := -L$(LIBD) -lzipbasic
54
SOURCES:= helloworld.c
55
LDSCRIPT:= ../zipsim.ld
56 2 dgisselq
 
57 202 dgisselq
$(OBJDIR)/%.o: %.c
58
        $(CC) $(CFLAGS) -c $< -o $@
59 2 dgisselq
 
60 202 dgisselq
helloworld: $(OBJDIR)/helloworld.o
61
        $(CC) -T $(LDSCRIPT) $(CFLAGS) $(LIBD)/crt0.o $(LIBS) $< -o $@
62 69 dgisselq
 
63 202 dgisselq
helloworld.txt: helloworld
64
        $(OBJDUMP) -dr $< > $@
65 197 dgisselq
 
66 202 dgisselq
define  build-depends
67
        $(CC) $(CFLAGS) -MM $(SOURCES) > $(OBJDIR)/xdepends.txt
68
        sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
69
        @rm -f $(OBJDIR)/xdepends.txt
70
endef
71 197 dgisselq
 
72 202 dgisselq
tags: $(SOURCES)
73
        @ctags $(SOURCES)
74 58 dgisselq
 
75 202 dgisselq
.PHONY: depends
76
depends: tags $(OBJDIR)/
77
        $(build-depends)
78 36 dgisselq
 
79 202 dgisselq
$(OBJDIR)/:
80
        @bash -c "if [[ ! -e $(OBJDIR) ]]; then mkdir -p $(OBJDIR)/; fi"
81 27 dgisselq
 
82 36 dgisselq
.PHONY: clean
83
clean:
84 202 dgisselq
        rm -rf helloworld

powered by: WebSVN 2.1.0

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