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

Subversion Repositories openarty

[/] [openarty/] [trunk/] [sw/] [board/] [Makefile] - Blame information for rev 38

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

Line No. Rev Author Line
1 31 dgisselq
################################################################################
2
##
3
## Filename:    Makefile
4
##
5
## Project:     OpenArty, an entirely open SoC based upon the Arty platform
6
##
7
## Purpose:
8
##
9
## Creator:     Dan Gisselquist, Ph.D.
10
##              Gisselquist Technology, LLC
11
##
12
################################################################################
13
##
14
## Copyright (C) 2015, Gisselquist Technology, LLC
15
##
16
## This program is free software (firmware): you can redistribute it and/or
17
## modify it under the terms of  the GNU General Public License as published
18
## by the Free Software Foundation, either version 3 of the License, or (at
19
## your option) any later version.
20
##
21
## This program is distributed in the hope that it will be useful, but WITHOUT
22
## ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
23
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
24
## for more details.
25
##
26
## License:     GPL, v3, as defined and found on www.gnu.org,
27
##              http:##www.gnu.org/licenses/gpl.html
28
##
29
##
30
################################################################################
31
##
32
##
33
.PHONY: all
34 36 dgisselq
PROGRAMS := exstartup oledtest gpsdump exmulti
35
all:    $(PROGRAMS)
36 34 dgisselq
OBJDIR := obj-zip
37
CC := zip-gcc
38
OBJDUMP := zip-objdump
39 36 dgisselq
SOURCES := exstartup.c bootloader.c gpsdump.c oledtest.c exmulti.c
40 34 dgisselq
HEADERS := artyboard.h zipsys.h
41 31 dgisselq
#
42 34 dgisselq
# For source analysis, the following macros are defined:
43 31 dgisselq
 
44 34 dgisselq
#
45
 
46
%.o: $(OBJDIR)/%.o
47
$(OBJDIR)/%.o: %.c
48 36 dgisselq
        $(CC) -O3 -c -fno-builtin $< -o $@
49 34 dgisselq
%.txt: %
50
        $(OBJDUMP) -S -D $^ > $@
51
 
52 31 dgisselq
exstartup: exstartup.c artyboard.h zipsys.h arty.ld
53 34 dgisselq
        $(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=exstartup.map exstartup.c -o exstartup
54
gpsdump: $(OBJDIR)/gpsdump.o $(OBJDIR)/bootloader.o arty.ld
55
        $(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=gpsdump.map $(OBJDIR)/gpsdump.o $(OBJDIR)/bootloader.o -o $@
56
oledtest: $(OBJDIR)/oledtest.o $(OBJDIR)/bootloader.o $(OBJDIR)/splash.o $(OBJDIR)/mug.o arty.ld
57 36 dgisselq
        $(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=oledtest.map $(OBJDIR)/oledtest.o $(OBJDIR)/bootloader.o $(OBJDIR)/splash.o $(OBJDIR)/mug.o -o $@
58 31 dgisselq
 
59 36 dgisselq
exmulti: $(OBJDIR)/exmulti.o $(OBJDIR)/bootloader.o arty.ld
60
        $(CC) -O3 -T arty.ld -fno-builtin -Wl,-Map=exmulti.map $(OBJDIR)/exmulti.o $(OBJDIR)/bootloader.o -o $@
61
 
62 31 dgisselq
exstartup.txt: exstartup
63 34 dgisselq
        $(OBJDUMP) -S -D $^ > $@
64 31 dgisselq
 
65 33 dgisselq
clean:
66 36 dgisselq
        rm -rf $(PROGRAMS) $(addsuffix .map,$(PROGRAMS)) $(addsuffix .txt,$(PROGRAMS))
67 34 dgisselq
        rm -rf $(OBJDIR)/
68
 
69
define  build-depends
70
        @echo "Building dependency file(s)"
71
        @$(CC) $(CFLAGS) -MM $(SOURCES) > $(OBJDIR)/xdepends.txt
72
        @sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
73
        @rm $(OBJDIR)/xdepends.txt
74
endef
75
 
76
tags: $(SOURCES) $(HEADERS)
77
        @echo "Generating tags"
78
        @ctags $(SOURCES) $(HEADERS)
79
 
80
$(OBJDIR)/depends.txt: $(OBJDIR)/
81
        $(build-depends)
82
 
83
$(OBJDIR)/:
84
        @bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR)/; fi"
85
 
86
-include $(OBJDIR)/depends.txt

powered by: WebSVN 2.1.0

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