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

Subversion Repositories xulalx25soc

[/] [xulalx25soc/] [trunk/] [sw/] [Makefile] - Blame information for rev 5

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

Line No. Rev Author Line
1 5 dgisselq
################################################################################
2
##
3
## Filename:    Makefile
4
##
5
## Project:     XuLA2 board
6
##
7
## Purpose:
8
##
9
##
10
## Creator:     Dan Gisselquist, Ph.D.
11
##              Gisselquist Technology, LLC
12
##
13
################################################################################
14
##
15
## Copyright (C) 2015, 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
## License:     GPL, v3, as defined and found on www.gnu.org,
28
##              http:##www.gnu.org/licenses/gpl.html
29
##
30
##
31
################################################################################
32
##
33
##
34
.PHONY: all
35
PROGRAMS := $(OBJDIR) usbtst wbregs netusb wbsettime dumpflash  \
36
        dumpsdram ziprun ramscope
37
all: $(PROGRAMS)
38
CXX := g++
39
LIBUSBINC := -I/usr/include/libusb-1.0/
40
LIBUSBDIR := -L/usr/lib/x86_64-linux-gnu
41
OBJDIR := obj-pc
42
ZIPD := /home/dan/work/rnd/zipcpu/trunk/sw/zasm
43
BUSSRCS := ttybus.cpp llcomms.cpp regdefs.cpp usbi.cpp
44
SOURCES := ziprun.cpp zipdbg.cpp dumpsdram.cpp wbregs.cpp netusb.cpp $(BUSSRCS)
45
HEADERS := llcomms.h ttybus.h devbus.h regdefs.h usbi.h
46
OBJECTS := $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(SOURCES)))
47
BUSOBJS := $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(BUSSRCS)))
48
CFLAGS := -g -Wall $(LIBUSBINC) -I. -I../../fpgalib/sw
49
LIBS := -lusb-1.0
50
 
51
all: $(PROGRAMS)
52
 
53
%.o: $(OBJDIR)/ $(OBJDIR)/%.o
54
$(OBJDIR)/%.o: %.cpp
55
        $(CXX) $(CFLAGS) -c $< -o $@
56
$(OBJDIR)/zipdbg.o: zipdbg.cpp
57
        $(CXX) $(CFLAGS) -I$(ZIPD) -c $< -o $@
58
$(OBJDIR)/cpuscope.o: cpuscope.cpp
59
        $(CXX) $(CFLAGS) -I$(ZIPD) -c $< -o $@
60
 
61
.PHONY: clean
62
clean:
63
        rm -rf $(OBJDIR)/ $(PROGRAMS)
64
 
65
 
66
# wbprogram: $(OBJDIR)/wbprogram.o $(OBJDIR)/flashdrvr.o $(BUSOBJS)
67
        # $(CXX) -g $^ -o $@
68
netusb: $(OBJDIR)/netusb.o $(OBJDIR)/usbi.o $(OBJDIR)/llcomms.o
69
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
70
wbsettime: $(OBJDIR)/wbsettime.o $(BUSOBJS)
71
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
72
wbregs: $(OBJDIR)/wbregs.o $(BUSOBJS)
73
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
74
dumpflash: $(OBJDIR)/dumpflash.o $(BUSOBJS)
75
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
76
cfgscope: $(OBJDIR)/cfgscope.o $(BUSOBJS)
77
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
78
ramscope: $(OBJDIR)/ramscope.o $(BUSOBJS)
79
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
80
dumpsdram: $(OBJDIR)/dumpsdram.o $(BUSOBJS)
81
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
82
ziprun: $(OBJDIR)/ziprun.o $(BUSOBJS)
83
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
84
ZIPOBJS_RAW := twoc.o zparser.o zopcodes.o
85
ZIPOBJS := $(addprefix $(ZIPD)/$(OBJDIR)/,$(ZIPOBJS_RAW))
86
zipdbg: $(OBJDIR)/zipdbg.o $(BUSOBJS) $(ZIPOBJS)
87
        $(CXX) $(CFLAGS) $^ $(LIBS) -lncurses -o $@
88
cpuscope: $(OBJDIR)/cpuscope.o $(BUSOBJS) $(ZIPOBJS)
89
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
90
 
91
nothing:
92
        @echo
93
 
94
# ziprun: $(OBJDIR)/ziprun.o $(BUSOBJS)
95
        # $(CXX) -g $^ -o $@
96
# zipdbg: zipdbg.cpp $(ZIPD)/zparser.cpp $(ZIPD)/zopcodes.cpp $(ZIPD)/twoc.cpp $(BUSOBJS)
97
        # $(CXX) -g -I../bench/cpp -I $(ZIPD)/ $^ -lncurses -o $@
98
 
99
usbtst: usbtst.cpp
100
        $(CXX) $(CFLAGS) usbtst.cpp $(LIBS) -o usbtst
101
txtest: txtest.cpp
102
        $(CXX) $(CFLAGS) txtest.cpp $(LIBS) -o txtest
103
 
104
 
105
define  build-depends
106
        @echo "Building dependency file(s)"
107
        @$(CXX) $(CPPFLAGS) -MM -I$(ZIPD) $(SOURCES) > $(OBJDIR)/xdepends.txt
108
        @sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
109
        @rm $(OBJDIR)/xdepends.txt
110
endef
111
 
112
tags: $(SOURCES) $(HEADERS)
113
        @echo "Generating tags"
114
        @ctags $(SOURCES) $(HEADERS)
115
 
116
.PHONY: depends
117
depends: tags
118
        $(build-depends)
119
 
120
$(OBJDIR)/depends.txt: $(OBJDIR)/ $(SOURCES) $(HEADERS)
121
        $(build-depends)
122
 
123
$(OBJDIR)/:
124
        @bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR); fi"
125
 
126
# obj-pc/usbi.o: usbi.cpp
127
        # $(CXX) $(LIBUSBINC) -I../../fpgalib/sw -c usbi.cpp  -o $@
128
 
129
-include $(OBJDIR)/depends.txt

powered by: WebSVN 2.1.0

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