Line 66... |
Line 66... |
## http://www.gnu.org/licenses/gpl.html
|
## http://www.gnu.org/licenses/gpl.html
|
##
|
##
|
################################################################################
|
################################################################################
|
##
|
##
|
##
|
##
|
all: test
|
.PHONY: all
|
|
all: test tags
|
YYMMDD=`date +%Y%m%d`
|
YYMMDD=`date +%Y%m%d`
|
CXX := g++
|
CXX := g++
|
FBDIR := .
|
FBDIR := .
|
VDIRFB:= $(FBDIR)/obj_dir
|
VDIRFB:= $(FBDIR)/obj_dir
|
RTLDR := ../../rtl
|
RTLDR := ../../rtl
|
VERILATOR := verilator
|
VERILATOR := verilator
|
VFLAGS := -Wall --MMD --trace -y ../../rtl -cc
|
VFLAGS := -Wall --MMD --trace -y $(RTLDR) -cc
|
|
|
.PHONY: test testline testhello speechfifo
|
.PHONY: test testline testhello speechfifo
|
test: testline testhello speechfifo
|
test: testline testhello speechfifo
|
testline: $(VDIRFB)/Vlinetest__ALL.a
|
testline: $(VDIRFB)/Vlinetest__ALL.a
|
testhello: $(VDIRFB)/Vhelloworld__ALL.a
|
testhello: $(VDIRFB)/Vhelloworld__ALL.a
|
speechfifo: $(VDIRFB)/Vspeechfifo__ALL.a
|
speechfifo: $(VDIRFB)/Vspeechfifo__ALL.a
|
|
|
$(VDIRFB)/Vlinetest__ALL.a: $(VDIRFB)/Vlinetest.h $(VDIRFB)/Vlinetest.cpp
|
$(VDIRFB)/Vlinetest__ALL.a: $(VDIRFB)/Vlinetest.cpp
|
$(VDIRFB)/Vlinetest__ALL.a: $(VDIRFB)/Vlinetest.mk
|
$(VDIRFB)/Vhelloworld__ALL.a: $(VDIRFB)/Vhelloworld.cpp
|
$(VDIRFB)/Vlinetest.h $(VDIRFB)/Vlinetest.cpp $(VDIRFB)/Vlinetest.mk: linetest.v
|
$(VDIRFB)/Vspeechfifo__ALL.a: $(VDIRFB)/Vspeechfifo.cpp
|
$(VDIRFB)/Vlinetest.h $(VDIRFB)/Vlinetest.cpp $(VDIRFB)/Vlinetest.mk: $(RTLDR)/rxuart.v $(RTLDR)/txuart.v
|
|
$(VDIRFB)/Vlinetest.h $(VDIRFB)/Vlinetest.cpp $(VDIRFB)/Vlinetest.mk: $(RTLDR)/rxuartlite.v $(RTLDR)/txuartlite.v
|
$(VDIRFB)/V%.mk: $(VDIRFB)/%.h
|
|
$(VDIRFB)/V%.h: $(VDIRFB)/%.cpp
|
$(VDIRFB)/Vhelloworld__ALL.a: $(VDIRFB)/Vhelloworld.h $(VDIRFB)/Vhelloworld.cpp
|
$(VDIRFB)/V%.cpp: $(FBDIR)/%.v
|
$(VDIRFB)/Vhelloworld__ALL.a: $(VDIRFB)/Vhelloworld.mk
|
|
$(VDIRFB)/Vhelloworld.h $(VDIRFB)/Vhelloworld.cpp $(VDIRFB)/Vhelloworld.mk: helloworld.v
|
|
$(VDIRFB)/Vhelloworld.h $(VDIRFB)/Vhelloworld.cpp $(VDIRFB)/Vhelloworld.mk: $(RTLDR)/txuartlite.v $(RTLDR)/txuart.v
|
|
|
|
SPEECHSRCS := $(addprefix $(RTLDR)/,rxuart.v txuart.v rxuartlite.v txuartlite.v ufifo.v wbuart.v)
|
|
SPEECHVFILES:= $(addprefix $(VDIRFB)/,Vspeechfifo.h Vspeechfifo.cpp Vspeechfifo.mk)
|
|
$(VDIRFB)/Vspeechfifo__ALL.a: $(VDIRFB)/Vspeechfifo.h $(VDIRFB)/Vspeechfifo.cpp
|
|
$(VDIRFB)/Vspeechfifo__ALL.a: $(VDIRFB)/Vspeechfifo.mk
|
|
$(SPEECHVFILES): speechfifo.v $(SPEECHSRCS)
|
|
|
|
$(VDIRFB)/V%.cpp $(VDIRFB)/V%.h $(VDIRFB)/V%.mk: $(FBDIR)/%.v
|
|
$(VERILATOR) $(VFLAGS) $*.v
|
$(VERILATOR) $(VFLAGS) $*.v
|
|
|
$(VDIRFB)/V%__ALL.a: $(VDIRFB)/V%.mk
|
$(VDIRFB)/V%__ALL.a: $(VDIRFB)/V%.cpp
|
cd $(VDIRFB); make -f V$*.mk
|
cd $(VDIRFB); make -f V$*.mk
|
|
|
|
tags: $(wildcard *.v) $(wildcard $(RTLDR)/*.v)
|
|
ctags *.v $(RTLDR)/*.v
|
|
|
.PHONY: clean
|
.PHONY: clean
|
clean:
|
clean:
|
rm -rf $(VDIRFB)/*.mk
|
rm -rf tags $(VDIRFB)/
|
rm -rf $(VDIRFB)/*.cpp
|
|
rm -rf $(VDIRFB)/*.h
|
DEPS := $(wildcard $(VDIRFB)/*.d)
|
rm -rf $(VDIRFB)/
|
|
|
ifneq ($(MAKECMDGOALS),clean)
|
DIRS := $(wildcard $(VDIRFB)/*.d)
|
ifneq ($(DEPS),)
|
ifneq ($(DIRS),)
|
include $(DEPS)
|
-include $(DIRS)
|
endif
|
endif
|
endif
|