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

Subversion Repositories openarty

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 dgisselq
################################################################################
2
##
3 51 dgisselq
## Filename:    Makefile
4 4 dgisselq
##
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 51 dgisselq
PROGRAMS := wbregs netuart wbsettime wbprogram netsetup manping \
41
        zipload zipstate zipdbg divutb
42 30 dgisselq
SCOPES := eqspiscope etxscope erxscope cpuscope
43 34 dgisselq
all: $(PROGRAMS) $(SCOPES) gps
44 4 dgisselq
CXX := g++
45
OBJDIR := obj-pc
46 51 dgisselq
BUSSRCS := ttybus.cpp llcomms.cpp regdefs.cpp byteswap.cpp
47 30 dgisselq
SOURCES := wbregs.cpp wbprogram.cpp netuart.cpp wbsettime.cpp           \
48 51 dgisselq
        dumpflash.cpp eqspiscope.cpp flashdrvr.cpp                      \
49
        scopecls.cpp sdramscope.cpp                                     \
50
        zipload.cpp zipstate.cpp zipdbg.cpp             \
51 30 dgisselq
        erxscope.cpp etxscope.cpp netsetup.cpp cpuscope.cpp             \
52 51 dgisselq
         mdioscope.cpp manping.cpp $(BUSSRCS)
53
        # ziprun.cpp cfgscope.cpp
54 4 dgisselq
HEADERS := llcomms.h ttybus.h devbus.h
55
OBJECTS := $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(SOURCES)))
56 51 dgisselq
BUSOBJS := $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(BUSSRCS)))
57
CFLAGS := -g -Wall -I.
58
LIBS :=
59
SUBMAKE := $(MAKE) --no-print-directory
60 4 dgisselq
 
61
%.o: $(OBJDIR)/%.o
62
$(OBJDIR)/%.o: %.cpp
63 51 dgisselq
        $(CXX) $(CFLAGS) -c $< -o $@
64
$(OBJDIR)/%.o: %.c
65
        $(CXX) $(CFLAGS) -c $< -o $@
66 4 dgisselq
 
67 34 dgisselq
.PHONY: gps
68
gps: $(BUSOBJS) $(OBJDIR)/scopecls.o
69 51 dgisselq
        @bash -c "if [[ -e gps/Makefile ]]; then $(SUBMAKE) --directory=gps; fi"
70 34 dgisselq
 
71 4 dgisselq
$(OBJDIR)/hsnetuart.o: netuart.cpp
72 51 dgisselq
        $(CXX) $(CFLAGS) -c -DHIGH_SPEED $< -o $@
73 4 dgisselq
 
74
.PHONY: clean
75
clean:
76 51 dgisselq
        rm -rf $(OBJDIR)/ $(PROGRAMS) a.out
77 4 dgisselq
 
78 51 dgisselq
$(OBJDIR)/scopecls.o: scopecls.cpp scopecls.h $(OBJDIR)/
79
$(OBJDIR)/eqspiscope.o: eqspiscope.cpp scopecls.h $(OBJDIR)/
80
$(OBJDIR)/dumpflash.o: dumpflash.cpp regdefs.h $(OBJDIR)/
81 14 dgisselq
 
82 4 dgisselq
netuart: $(OBJDIR)/netuart.o
83 51 dgisselq
        $(CXX) $(CFLAGS) $^ -o $@
84 4 dgisselq
hsnetuart: $(OBJDIR)/hsnetuart.o
85 51 dgisselq
        $(CXX) $(CFLAGS) $^ -o $@
86 34 dgisselq
#
87
# Some simple programs that just depend upon the ability to talk to the FPGA,
88
# and little more.
89 4 dgisselq
wbsettime: $(OBJDIR)/wbsettime.o $(BUSOBJS)
90 51 dgisselq
        $(CXX) $(CFLAGS) $^ -o $@
91 6 dgisselq
mtest: $(OBJDIR)/mtest.o $(BUSOBJS)
92 51 dgisselq
        $(CXX) $(CFLAGS) $^ -o $@
93 30 dgisselq
manping: $(OBJDIR)/manping.o $(BUSOBJS)
94 51 dgisselq
        $(CXX) $(CFLAGS) $^ -o $@
95 30 dgisselq
zipstate: $(OBJDIR)/zipstate.o $(BUSOBJS)
96 51 dgisselq
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
97 30 dgisselq
netsetup: $(OBJDIR)/netsetup.o $(BUSOBJS)
98 51 dgisselq
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
99
wbregs: $(OBJDIR)/wbregs.o $(BUSOBJS)
100
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
101 4 dgisselq
dumpflash: $(OBJDIR)/dumpflash.o $(BUSOBJS)
102 51 dgisselq
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
103
divutb: $(OBJDIR)/divutb.o
104
        $(CXX) $(CFLAGS) $^ -o $@
105 34 dgisselq
 
106
#
107
# Programs that depend upon not just the bus objects, but the flash driver
108
# as well.
109 30 dgisselq
wbprogram: $(OBJDIR)/wbprogram.o $(OBJDIR)/flashdrvr.o $(BUSOBJS)
110
        $(CXX) -g $^ -o $@
111 51 dgisselq
zipload: $(OBJDIR)/zipload.o $(OBJDIR)/flashdrvr.o $(BUSOBJS) $(OBJDIR)/zipelf.o
112 30 dgisselq
        $(CXX) -g $^ -lelf -o $@
113
 
114
 
115
## SCOPES
116 34 dgisselq
# These depend upon the scopecls.o, the bus objects, as well as their
117
# main file(s).
118
eqspiscope: $(OBJDIR)/eqspiscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
119
        $(CXX) -g $^ -o $@
120
sdramscope: $(OBJDIR)/sdramscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
121
        $(CXX) -g $^ -o $@
122 14 dgisselq
cfgscope: $(OBJDIR)/cfgscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
123
        $(CXX) -g $^ -o $@
124 30 dgisselq
cpuscope: $(OBJDIR)/cpuscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
125 14 dgisselq
        $(CXX) -g $^ -o $@
126 30 dgisselq
erxscope: $(OBJDIR)/erxscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
127
        $(CXX) -g $^ -o $@
128
etxscope: $(OBJDIR)/etxscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
129
        $(CXX) -g $^ -o $@
130
mdioscope: $(OBJDIR)/mdioscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
131
        $(CXX) -g $^ -o $@
132
wbuscope: $(OBJDIR)/wbuscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
133
        $(CXX) -g $^ -o $@
134 4 dgisselq
 
135 34 dgisselq
#
136 51 dgisselq
DBGSRCS  := zopcodes.cpp twoc.cpp
137
DBGOBJS := $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(DBGSRCS)))
138 30 dgisselq
zipdbg: $(OBJDIR)/zipdbg.o $(BUSOBJS) $(DBGOBJS)
139 51 dgisselq
        $(CXX) -g $^ -lcurses -o $@
140 30 dgisselq
 
141 4 dgisselq
define  build-depends
142
        @echo "Building dependency file(s)"
143 51 dgisselq
        @bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR)/; fi"
144
        $(CXX) $(CPPFLAGS) -MM $(SOURCES) > $(OBJDIR)/xdepends.txt
145 4 dgisselq
        @sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
146
        @rm $(OBJDIR)/xdepends.txt
147
endef
148
 
149
tags: $(SOURCES) $(HEADERS)
150
        @echo "Generating tags"
151
        @ctags $(SOURCES) $(HEADERS)
152
 
153
.PHONY: depends
154
depends: tags
155
        $(build-depends)
156
 
157 51 dgisselq
$(OBJDIR)/depends.txt: $(SOURCES) $(HEADERS)
158 4 dgisselq
        $(build-depends)
159
 
160
$(OBJDIR)/:
161
        @bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR)/; fi"
162
 
163
-include $(OBJDIR)/depends.txt

powered by: WebSVN 2.1.0

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