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

Subversion Repositories zipcpu

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

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

Line No. Rev Author Line
1 2 dgisselq
################################################################################
2
#
3
# Filename:     Makefile
4
#
5
# Project:      Zip CPU -- a small, lightweight, RISC CPU soft core
6
#
7 202 dgisselq
# 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 2 dgisselq
#
10 202 dgisselq
# Targets include:
11 2 dgisselq
#
12 202 dgisselq
#               helloworld
13 2 dgisselq
#
14 149 dgisselq
#
15
#
16 2 dgisselq
# Creator:      Dan Gisselquist, Ph.D.
17 69 dgisselq
#               Gisselquist Technology, LLC
18 2 dgisselq
#
19
################################################################################
20
#
21 202 dgisselq
# Copyright (C) 2017, Gisselquist Technology, LLC
22 2 dgisselq
#
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 202 dgisselq
# 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 2 dgisselq
# License:      GPL, v3, as defined and found on www.gnu.org,
39
#               http://www.gnu.org/licenses/gpl.html
40
#
41
#
42
################################################################################
43
#
44 202 dgisselq
.PHONY: all
45
all: helloworld
46 2 dgisselq
 
47 202 dgisselq
CC      := zip-gcc
48
OBJDUMP := zip-objdump
49
OBJDIR := obj-zip
50
CFLAGS := -O3
51
LIBD   := ../../sw/install/cross-tools/zip/lib
52
LIBS   := -L$(LIBD) -lzipbasic
53
SOURCES:= helloworld.c
54
LDSCRIPT:= ../zipsim.ld
55 2 dgisselq
 
56 202 dgisselq
$(OBJDIR)/%.o: %.c
57
        $(CC) $(CFLAGS) -c $< -o $@
58 2 dgisselq
 
59 202 dgisselq
helloworld: $(OBJDIR)/helloworld.o
60
        $(CC) -T $(LDSCRIPT) $(CFLAGS) $(LIBD)/crt0.o $(LIBS) $< -o $@
61 69 dgisselq
 
62 202 dgisselq
helloworld.txt: helloworld
63
        $(OBJDUMP) -dr $< > $@
64 197 dgisselq
 
65 202 dgisselq
define  build-depends
66
        $(CC) $(CFLAGS) -MM $(SOURCES) > $(OBJDIR)/xdepends.txt
67
        sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
68
        @rm -f $(OBJDIR)/xdepends.txt
69
endef
70 197 dgisselq
 
71 202 dgisselq
tags: $(SOURCES)
72
        @ctags $(SOURCES)
73 58 dgisselq
 
74 202 dgisselq
.PHONY: depends
75
depends: tags $(OBJDIR)/
76
        $(build-depends)
77 36 dgisselq
 
78 202 dgisselq
$(OBJDIR)/:
79
        @bash -c "if [[ ! -e $(OBJDIR) ]]; then mkdir -p $(OBJDIR)/; fi"
80 27 dgisselq
 
81 36 dgisselq
.PHONY: clean
82
clean:
83 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.