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 |
|
|
PROGRAMS := wbregs netuart wbsettime dumpflash # wbprogram
|
41 |
|
|
all: $(PROGRAMS)
|
42 |
|
|
CXX := g++
|
43 |
|
|
OBJDIR := obj-pc
|
44 |
|
|
# ZIPD := /home/dan/work/rnd/zipcpu/trunk/sw/zasm
|
45 |
|
|
BUSOBJS := $(OBJDIR)/ttybus.o $(OBJDIR)/llcomms.o $(OBJDIR)/regdefs.o
|
46 |
|
|
# BUSOBJS := $(OBJDIR)/portbus.o $(OBJDIR)/llcomms.o $(OBJDIR)/regdefs.o
|
47 |
|
|
SOURCES := wbregs.cpp wbprogram.cpp netuart.cpp wbsettime.cpp \
|
48 |
|
|
ttybus.cpp llcomms.cpp
|
49 |
|
|
# ziprun.cpp
|
50 |
|
|
# dumpmem.cpp nmea.cpp display.cpp
|
51 |
|
|
HEADERS := llcomms.h ttybus.h devbus.h
|
52 |
|
|
OBJECTS := $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(SOURCES)))
|
53 |
|
|
|
54 |
|
|
%.o: $(OBJDIR)/%.o
|
55 |
|
|
$(OBJDIR)/%.o: %.cpp
|
56 |
|
|
$(CXX) -g -c $< -o $@
|
57 |
|
|
|
58 |
|
|
$(OBJDIR)/hsnetuart.o: netuart.cpp
|
59 |
|
|
$(CXX) -g -c -DHIGH_SPEED $< -o $@
|
60 |
|
|
|
61 |
|
|
.PHONY: clean
|
62 |
|
|
clean:
|
63 |
|
|
rm -rf $(OBJDIR)/*.o $(PROGRAMS)
|
64 |
|
|
|
65 |
|
|
# dumpflash: $(OBJDIR)/dumpflash.o $(BUSOBJS)
|
66 |
|
|
# $(CXX) -g $^ -o $@
|
67 |
|
|
# wbprogram: $(OBJDIR)/wbprogram.o $(OBJDIR)/flashdrvr.o $(BUSOBJS)
|
68 |
|
|
# $(CXX) -g $^ -o $@
|
69 |
|
|
netuart: $(OBJDIR)/netuart.o
|
70 |
|
|
$(CXX) -g $^ -o $@
|
71 |
|
|
hsnetuart: $(OBJDIR)/hsnetuart.o
|
72 |
|
|
$(CXX) -g $^ -o $@
|
73 |
|
|
wbsettime: $(OBJDIR)/wbsettime.o $(BUSOBJS)
|
74 |
|
|
$(CXX) -g $^ -o $@
|
75 |
6 |
dgisselq |
mtest: $(OBJDIR)/mtest.o $(BUSOBJS)
|
76 |
|
|
$(CXX) -g $^ -o $@
|
77 |
4 |
dgisselq |
wbregs: $(OBJDIR)/wbregs.o $(BUSOBJS)
|
78 |
|
|
$(CXX) -g $^ -o $@
|
79 |
|
|
dumpflash: $(OBJDIR)/dumpflash.o $(BUSOBJS)
|
80 |
|
|
$(CXX) -g $^ -o $@
|
81 |
|
|
eqspiscope: $(OBJDIR)/eqspiscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
|
82 |
|
|
$(CXX) -g $^ -o $@
|
83 |
6 |
dgisselq |
sdramscope: $(OBJDIR)/sdramscope.o $(OBJDIR)/scopecls.o $(BUSOBJS)
|
84 |
|
|
$(CXX) -g $^ -o $@
|
85 |
4 |
dgisselq |
# ziprun: $(OBJDIR)/ziprun.o $(OBJDIR)/flashdrvr.o $(BUSOBJS)
|
86 |
|
|
# $(CXX) -g $^ -lelf -o $@
|
87 |
|
|
# zipdbg: zipdbg.cpp $(ZIPD)/zparser.cpp $(ZIPD)/zopcodes.cpp $(ZIPD)/twoc.cpp $(BUSOBJS)
|
88 |
|
|
# $(CXX) -g -I../bench/cpp -I $(ZIPD)/ $^ -lncurses -o $@
|
89 |
|
|
# zipstate: zipstate.cpp $(BUSOBJS)
|
90 |
|
|
# $(CXX) -g $^ -o $@
|
91 |
|
|
|
92 |
|
|
define build-depends
|
93 |
|
|
@echo "Building dependency file(s)"
|
94 |
|
|
@$(CXX) $(CPPFLAGS) -MM $(SOURCES) > $(OBJDIR)/xdepends.txt
|
95 |
|
|
@sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
|
96 |
|
|
@rm $(OBJDIR)/xdepends.txt
|
97 |
|
|
endef
|
98 |
|
|
|
99 |
|
|
tags: $(SOURCES) $(HEADERS)
|
100 |
|
|
@echo "Generating tags"
|
101 |
|
|
@ctags $(SOURCES) $(HEADERS)
|
102 |
|
|
|
103 |
|
|
.PHONY: depends
|
104 |
|
|
depends: tags
|
105 |
|
|
$(build-depends)
|
106 |
|
|
|
107 |
|
|
$(OBJDIR)/depends.txt: $(OBJDIR)/ $(SOURCES) $(HEADERS)
|
108 |
|
|
$(build-depends)
|
109 |
|
|
|
110 |
|
|
$(OBJDIR)/:
|
111 |
|
|
@bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR)/; fi"
|
112 |
|
|
|
113 |
|
|
-include $(OBJDIR)/depends.txt
|