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

Subversion Repositories xulalx25soc

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

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 17 dgisselq
        dumpsdram ziprun ramscope zipstate zipdbg cfgscope
37 5 dgisselq
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 29 dgisselq
SOURCES := ziprun.cpp zipdbg.cpp dumpsdram.cpp wbregs.cpp netusb.cpp    \
45
                flashdrvr.cpp $(BUSSRCS)
46
HEADERS := llcomms.h ttybus.h devbus.h regdefs.h usbi.h flashdrvr.h
47 5 dgisselq
OBJECTS := $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(SOURCES)))
48
BUSOBJS := $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(BUSSRCS)))
49
CFLAGS := -g -Wall $(LIBUSBINC) -I. -I../../fpgalib/sw
50
LIBS := -lusb-1.0
51
 
52
all: $(PROGRAMS)
53
 
54
%.o: $(OBJDIR)/ $(OBJDIR)/%.o
55
$(OBJDIR)/%.o: %.cpp
56
        $(CXX) $(CFLAGS) -c $< -o $@
57
$(OBJDIR)/zipdbg.o: zipdbg.cpp
58
        $(CXX) $(CFLAGS) -I$(ZIPD) -c $< -o $@
59
$(OBJDIR)/cpuscope.o: cpuscope.cpp
60
        $(CXX) $(CFLAGS) -I$(ZIPD) -c $< -o $@
61
 
62
.PHONY: clean
63
clean:
64
        rm -rf $(OBJDIR)/ $(PROGRAMS)
65
 
66
 
67
# wbprogram: $(OBJDIR)/wbprogram.o $(OBJDIR)/flashdrvr.o $(BUSOBJS)
68
        # $(CXX) -g $^ -o $@
69
netusb: $(OBJDIR)/netusb.o $(OBJDIR)/usbi.o $(OBJDIR)/llcomms.o
70
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
71
wbsettime: $(OBJDIR)/wbsettime.o $(BUSOBJS)
72
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
73
wbregs: $(OBJDIR)/wbregs.o $(BUSOBJS)
74
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
75
dumpflash: $(OBJDIR)/dumpflash.o $(BUSOBJS)
76
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
77
cfgscope: $(OBJDIR)/cfgscope.o $(BUSOBJS)
78
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
79
ramscope: $(OBJDIR)/ramscope.o $(BUSOBJS)
80
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
81
dumpsdram: $(OBJDIR)/dumpsdram.o $(BUSOBJS)
82
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
83 29 dgisselq
ziprun: $(OBJDIR)/ziprun.o $(OBJDIR)/flashdrvr.o $(BUSOBJS)
84
        $(CXX) $(CFLAGS) $^ $(LIBS) -lelf -o $@
85 11 dgisselq
zipstate: $(OBJDIR)/zipstate.o $(BUSOBJS)
86
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
87 5 dgisselq
ZIPOBJS_RAW := twoc.o zparser.o zopcodes.o
88
ZIPOBJS := $(addprefix $(ZIPD)/$(OBJDIR)/,$(ZIPOBJS_RAW))
89
zipdbg: $(OBJDIR)/zipdbg.o $(BUSOBJS) $(ZIPOBJS)
90
        $(CXX) $(CFLAGS) $^ $(LIBS) -lncurses -o $@
91
cpuscope: $(OBJDIR)/cpuscope.o $(BUSOBJS) $(ZIPOBJS)
92
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
93
 
94
nothing:
95
        @echo
96
 
97
# ziprun: $(OBJDIR)/ziprun.o $(BUSOBJS)
98
        # $(CXX) -g $^ -o $@
99
# zipdbg: zipdbg.cpp $(ZIPD)/zparser.cpp $(ZIPD)/zopcodes.cpp $(ZIPD)/twoc.cpp $(BUSOBJS)
100
        # $(CXX) -g -I../bench/cpp -I $(ZIPD)/ $^ -lncurses -o $@
101
 
102
usbtst: usbtst.cpp
103
        $(CXX) $(CFLAGS) usbtst.cpp $(LIBS) -o usbtst
104
txtest: txtest.cpp
105
        $(CXX) $(CFLAGS) txtest.cpp $(LIBS) -o txtest
106
 
107
 
108
define  build-depends
109
        @echo "Building dependency file(s)"
110
        @$(CXX) $(CPPFLAGS) -MM -I$(ZIPD) $(SOURCES) > $(OBJDIR)/xdepends.txt
111
        @sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
112
        @rm $(OBJDIR)/xdepends.txt
113
endef
114
 
115
tags: $(SOURCES) $(HEADERS)
116
        @echo "Generating tags"
117
        @ctags $(SOURCES) $(HEADERS)
118
 
119
.PHONY: depends
120
depends: tags
121
        $(build-depends)
122
 
123
$(OBJDIR)/depends.txt: $(OBJDIR)/ $(SOURCES) $(HEADERS)
124
        $(build-depends)
125
 
126
$(OBJDIR)/:
127
        @bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR); fi"
128
 
129
# obj-pc/usbi.o: usbi.cpp
130
        # $(CXX) $(LIBUSBINC) -I../../fpgalib/sw -c usbi.cpp  -o $@
131
 
132
-include $(OBJDIR)/depends.txt

powered by: WebSVN 2.1.0

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