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

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [sw/] [host/] [Makefile] - Blame information for rev 8

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

Line No. Rev Author Line
1 8 dgisselq
all:
2
PROGRAMS := wbregs
3
all: $(PROGRAMS)
4
 
5
CXX := g++
6
OBJDIR := obj-pc
7
BUSSRCS:= deppbus.cpp regdefs.cpp
8
SOURCES:= wbregs.cpp # flashload.cpp/ziprun.cpp
9
ADEPT := ../../../refs/digilent.adept.sdk_2.3.1
10
HEADERS:= deppbus.h devbus.h flashdrvr.h regdefs.h twoc.h
11
OBJECTS:= $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(SOURCES)))
12
BUSOBJS:= $(addprefix $(OBJDIR)/,$(subst .cpp,.o,$(BUSSRCS)))
13
CFLAGS := -g -Wall -I$(ADEPT)/inc -I.
14
LIBS := -L /usr/lib64/digilent/adept -ldmgr -ldepp
15
 
16
%.o: $(OBJDIR)/ $(OBJDIR)/%.o
17
$(OBJDIR)/%.o: %.cpp
18
        $(CXX) $(CFLAGS) -c $< -o $@
19
 
20
.PHONY: clean
21
clean:
22
        rm -rf $(OBJDIR)/ $(PROGRAMS)
23
 
24
wbregs: $(OBJDIR)/wbregs.o $(BUSOBJS)
25
        $(CXX) $(CFLAGS) $^ $(LIBS) -o $@
26
 
27
define  build-depends
28
        @echo "Building dependency file(s)"
29
        @$(CXX) $(CFLAGS) -MM $(SOURCES) > $(OBJDIR)/xdepends.txt
30
        @sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
31
        @rm $(OBJDIR)/xdepends.txt
32
endef
33
 
34
tags: $(SOURCES) $(HEADERS)
35
        @ctags $(SOURCES) $(HEADERS)
36
 
37
.PHONY: depends
38
depends: tags
39
        $(build-depends)
40
 
41
$(OBJDIR)/depends.txt: $(OBJDIR)/ $(SOURCES) $(HEADERS)
42
        $(build-depends)
43
 
44
$(OBJDIR)/:
45
        @bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR); fi"
46
 
47
-include $(OBJDIR)/depends.txt

powered by: WebSVN 2.1.0

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