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

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [sw/] [host/] [Makefile] - Rev 11

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

all:
PROGRAMS := wbregs readflash zipload
all: $(PROGRAMS)

CXX := g++
OBJDIR := obj-pc
# BUSSRCS:= deppbus.cpp regdefs.cpp
BUSSRCS:= deppi.cpp regdefs.cpp llcomms.cpp ttybus.cpp
SOURCES:= wbregs.cpp readflash.cpp zipload.cpp flashdrvr.cpp # flashload.cpp/ziprun.cpp
ADEPT := ../../../refs/digilent.adept.sdk_2.3.1
HEADERS:= deppbus.h devbus.h flashdrvr.h regdefs.h twoc.h
OBJECTS:= $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(SOURCES)))
BUSOBJS:= $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(BUSSRCS)))
CFLAGS := -g -Wall -I$(ADEPT)/inc -I.
LIBS := -L /usr/lib64/digilent/adept -ldmgr -ldepp

%.o: $(OBJDIR)/ $(OBJDIR)/%.o
$(OBJDIR)/%.o: %.cpp
        $(CXX) $(CFLAGS) -c $< -o $@

.PHONY: clean
clean:
        rm -rf $(OBJDIR)/ $(PROGRAMS)

wbregs: $(OBJDIR)/wbregs.o $(BUSOBJS)
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@

readflash: $(OBJDIR)/readflash.o $(BUSOBJS)
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@

zipload: $(OBJDIR)/zipload.o $(OBJDIR)/flashdrvr.o $(BUSOBJS)
        $(CXX) $(CFLAGS) $^ $(LIBS) -lelf -o $@

define  build-depends
        @echo "Building dependency file(s)"
        @$(CXX) $(CFLAGS) -MM $(SOURCES) $(BUSSRCS) > $(OBJDIR)/xdepends.txt
        @sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
        @rm $(OBJDIR)/xdepends.txt
endef

tags: $(SOURCES) $(HEADERS)
        @ctags $(SOURCES) $(HEADERS)

.PHONY: depends
depends: tags
        $(build-depends)

$(OBJDIR)/depends.txt: $(OBJDIR)/ $(SOURCES) $(HEADERS)
        $(build-depends)

$(OBJDIR)/:
        @bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR); fi"

-include $(OBJDIR)/depends.txt

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

powered by: WebSVN 2.1.0

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