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

Subversion Repositories openarty

[/] [openarty/] [trunk/] [sw/] [zlib/] [Makefile] - Blame information for rev 56

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

Line No. Rev Author Line
1 54 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) 2017, 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
## You should have received a copy of the GNU General Public License along
27
## with this program.  (It's in the $(ROOT)/doc directory, run make with no
28
## target there if the PDF file isn't present.)  If not, see
29
##  for a copy.
30
##
31
## License:     GPL, v3, as defined and found on www.gnu.org,
32
##              http://www.gnu.org/licenses/gpl.html
33
##
34
##
35
################################################################################
36
##
37
##
38
CC := zip-gcc
39
AR := zip-ar
40
OBJDIR  := obj-zip
41
CFLAGS  := -O3
42
LIBSRCS := udiv.c umod.c artyboard.c crt0.c
43
LIBOBJS := $(addprefix $(OBJDIR)/,$(subst .c,.o,$(LIBSRCS)))
44
all: libarty.a
45
 
46
$(OBJDIR)/%.o: %.c
47
        $(CC) $(CFLAGS) -c $< -o $@
48
 
49
$(OBJDIR)/%.s: %.c
50
        $(CC) $(CFLAGS) -fdump-rtl-all -S $< -o $@
51
 
52
$(OBJDIR)/crt0.o: crt0.c
53
        $(CC) $(CFLAGS) -ffreestanding -c $< -o $@
54
 
55
libarty.a: $(LIBOBJS)
56
        $(AR) -cru libarty.a $(LIBOBJS)
57
 
58
clean:
59
        rm -rf libarty.a libarty.a $(OBJDIR)/
60
 
61
define  build-depends
62
        @echo "Building dependency file(s)"
63
        @$(CC) $(CFLAGS) -MM $(LIBSRCS) > $(OBJDIR)/xdepends.txt
64
        @sed -e 's/^.*.o: /$(OBJDIR)\/&/' < $(OBJDIR)/xdepends.txt > $(OBJDIR)/depends.txt
65
        @rm $(OBJDIR)/xdepends.txt
66
endef
67
 
68
tags: $(LIBSRCS) $(HEADERS)
69
        @echo "Generating tags"
70
        @ctags $(LIBSRCS) $(HEADERS)
71
 
72
$(OBJDIR)/depends.txt: $(OBJDIR)/
73
        $(build-depends)
74
 
75
.PHONY: depends
76
depends:
77
        $(build-depends)
78
 
79
$(OBJDIR)/:
80
        @bash -c "if [ ! -e $(OBJDIR) ]; then mkdir -p $(OBJDIR)/; fi"
81
 
82
-include $(OBJDIR)/depends.txt

powered by: WebSVN 2.1.0

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