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

Subversion Repositories openarty

[/] [openarty/] [trunk/] [sw/] [host/] [Makefile] - Blame information for rev 14

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

Line No. Rev Author Line
1 4 dgisselq
################################################################################
2
##
3
## Filename:    Makefile
4
##
5
## Project:     OpenArty, an entirely open SoC based upon the Arty platform
6
##
7
## Purpose:
8
## Targets:
9
##
10
## Creator:     Dan Gisselquist, Ph.D.
11
##              Gisselquist Technology, LLC
12
##
13
################################################################################
14
##
15
## Copyright (C) 2015-2016, Gisselquist Technology, LLC
16
##
17
## This program is free software (firmware): you can redistribute it and/or
18
## modify it under the terms of  the GNU General Public License as published
19
## by the Free Software Foundation, either version 3 of the License, or (at
20
## your option) any later version.
21
##
22
## This program is distributed in the hope that it will be useful, but WITHOUT
23
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
24
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
25
## for more details.
26
##
27
## You should have received a copy of the GNU General Public License along
28
## with this program.  (It's in the $(ROOT)/doc directory, run make with no
29
## target there if the PDF file isn't present.)  If not, see
30
##  for a copy.
31
##
32
## License:     GPL, v3, as defined and found on www.gnu.org,
33
##              http://www.gnu.org/licenses/gpl.html
34
##
35
##
36
################################################################################
37
##
38
##
39
.PHONY: all
40 14 dgisselq
PROGRAMS := wbregs netuart wbsettime dumpflash wbprogram
41 4 dgisselq
all: $(PROGRAMS)
42
CXX := g++
43
OBJDIR := obj-pc
44
BUSOBJS := $(OBJDIR)/ttybus.o $(OBJDIR)/llcomms.o $(OBJDIR)/regdefs.o
45
SOURCES := wbregs.cpp wbprogram.cpp netuart.cpp wbsettime.cpp   \
46 14 dgisselq
        ttybus.cpp llcomms.cpp dumpflash.cpp eqspiscope.cpp flashdrvr.cpp \
47
        portbus.cpp regdefs.cpp scopecls.cpp sdramscope.cpp ttybus.cpp  \
48
        cfgscope.cpp
49
        # ziprun.cpp zipload.cpp
50 4 dgisselq
HEADERS := llcomms.h ttybus.h devbus.h
51
OBJECTS := $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(SOURCES)))
52
 
53
%.o: $(OBJDIR)/%.o
54
$(OBJDIR)/%.o: %.cpp
55
        $(CXX) -g -c $< -o $@
56
 
57
$(OBJDIR)/hsnetuart.o: netuart.cpp
58
        $(CXX) -g -c -DHIGH_SPEED $< -o $@
59
 
60
.PHONY: clean
61
clean:
62
        rm -rf $(OBJDIR)/*.o $(PROGRAMS)
63
 
64 14 dgisselq
$(OBJDIR)/scopecls.o: scopecls.cpp scopecls.h
65
$(OBJDIR)/eqspiscope.o: eqspiscope.cpp scopecls.h
66
$(OBJDIR)/dumpflash.o: dumpflash.cpp regdefs.h
67
 
68 4 dgisselq
netuart: $(OBJDIR)/netuart.o
69
        $(CXX) -g $^ -o $@
70
hsnetuart: $(OBJDIR)/hsnetuart.o
71
        $(CXX) -g $^ -o $@
72
wbsettime: $(OBJDIR)/wbsettime.o $(BUSOBJS)
73
        $(CXX) -g $^ -o $@
74 6 dgisselq
mtest: $(OBJDIR)/mtest.o $(BUSOBJS)
75
        $(CXX) -g $^ -o $@
76 4 dgisselq
wbregs: $(OBJDIR)/wbregs.o $(BUSOBJS)
77
        $(CXX) -g $^ -o $@
78
dumpflash: $(OBJDIR)/dumpflash.o $(BUSOBJS)
79
        $(CXX) -g $^ -o $@
80
eqspiscope: $(OBJDIR)/eqspiscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
81
        $(CXX) -g $^ -o $@
82 6 dgisselq
sdramscope: $(OBJDIR)/sdramscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
83
        $(CXX) -g $^ -o $@
84 14 dgisselq
cfgscope: $(OBJDIR)/cfgscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
85
        $(CXX) -g $^ -o $@
86
wbprogram: $(OBJDIR)/wbprogram.o $(OBJDIR)/flashdrvr.o $(BUSOBJS)
87
        $(CXX) -g $^ -o $@
88 4 dgisselq
# ziprun: $(OBJDIR)/ziprun.o $(OBJDIR)/flashdrvr.o $(BUSOBJS)
89
#       $(CXX) -g $^ -lelf -o $@
90
# zipdbg: zipdbg.cpp $(ZIPD)/zparser.cpp $(ZIPD)/zopcodes.cpp $(ZIPD)/twoc.cpp $(BUSOBJS)
91
#       $(CXX) -g -I../bench/cpp -I $(ZIPD)/ $^ -lncurses -o $@
92
# zipstate: zipstate.cpp $(BUSOBJS)
93
        # $(CXX) -g $^ -o $@
94
 
95
define  build-depends
96
        @echo "Building dependency file(s)"
97
        @$(CXX) $(CPPFLAGS) -MM $(SOURCES) > $(OBJDIR)/xdepends.txt
98
        @sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
99
        @rm $(OBJDIR)/xdepends.txt
100
endef
101
 
102
tags: $(SOURCES) $(HEADERS)
103
        @echo "Generating tags"
104
        @ctags $(SOURCES) $(HEADERS)
105
 
106
.PHONY: depends
107
depends: tags
108
        $(build-depends)
109
 
110
$(OBJDIR)/depends.txt: $(OBJDIR)/ $(SOURCES) $(HEADERS)
111
        $(build-depends)
112
 
113
$(OBJDIR)/:
114
        @bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR)/; fi"
115
 
116
-include $(OBJDIR)/depends.txt

powered by: WebSVN 2.1.0

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