OpenCores
URL https://opencores.org/ocsvn/hf-risc/hf-risc/trunk

Subversion Repositories hf-risc

[/] [hf-risc/] [trunk/] [tools/] [riscv-gnu-toolchain-master/] [newlib/] [libgloss/] [riscv/] [Makefile.in] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 serginhofr
#-------------------------------------------------------------------------
2
# Source files
3
#-------------------------------------------------------------------------
4
 
5
gloss_hdrs = \
6
        machine/syscfg.h \
7
        machine/syscall.h \
8
        machine/bthread.h \
9
        memory.h \
10
 
11
gloss_srcs = \
12
        syscalls.c \
13
        bthread-keys.c \
14
 
15
# Extra files
16
 
17
crt0_asm      = crt0.S
18
linker_script = riscv.ld
19
 
20
# Multilib support variables.
21
# TOP is used instead of MULTI{BUILD,SRC}TOP.
22
 
23
MULTIDIRS =
24
MULTISUBDIR =
25
MULTIDO = true
26
MULTICLEAN = true
27
 
28
#-------------------------------------------------------------------------
29
# Basic setup
30
#-------------------------------------------------------------------------
31
 
32
# Remove all default implicit rules since they can cause subtle bugs
33
# and they just make things run slower
34
 
35
.SUFFIXES:
36
% : %,v
37
% : RCS/%,v
38
% : RCS/%
39
% : s.%
40
% : SCCS/s.%
41
 
42
# Default is to build the prereqs of the all target (defined at bottom)
43
 
44
default : all
45
.PHONY : default
46
 
47
# Source directory
48
 
49
obj_dir := .
50
src_dir := @srcdir@
51
VPATH   := $(src_dir) $(src_dir)/machine
52
 
53
# Installation directories
54
 
55
prefix  := @prefix@
56
DESTDIR ?= $(prefix)
57
 
58
install_hdrs_dir := $(DESTDIR)$(prefix)/$(target_alias)/include/machine
59
install_libs_dir  = $(DESTDIR)$(prefix)/$(target_alias)/lib${MULTISUBDIR}
60
 
61
#-------------------------------------------------------------------------
62
# Programs and flags
63
#-------------------------------------------------------------------------
64
 
65
# C compiler
66
 
67
CC            := @CC@
68
CFLAGS        := @CFLAGS@
69
CPPFLAGS      := -I$(obj_dir) -I$(src_dir)
70
COMPILE       := $(CC) -MMD -MP $(CPPFLAGS) $(CFLAGS)
71
 
72
# Library creation
73
 
74
AR            := @AR@
75
RANLIB        := @RANLIB@
76
 
77
# Installation
78
 
79
MKINSTALLDIRS := $(src_dir)/mk-install-dirs.sh
80
INSTALL       := @INSTALL@
81
INSTALL_HDR   := $(INSTALL) -m 444
82
INSTALL_LIB   := $(INSTALL) -m 644
83
 
84
#-------------------------------------------------------------------------
85
# Build Object Files from C Source
86
#-------------------------------------------------------------------------
87
 
88
gloss_c_srcs = $(filter %.c, $(gloss_srcs))
89
gloss_c_objs = $(patsubst %.c, %.o, $(notdir $(gloss_c_srcs)))
90
gloss_c_deps = $(patsubst %.c, %.d, $(notdir $(gloss_c_srcs)))
91
 
92
$(gloss_c_objs) : %.o : %.c
93
        $(COMPILE) -c $<
94
 
95
objs += $(gloss_c_objs)
96
deps += $(gloss_c_deps)
97
junk += $(gloss_c_deps) $(gloss_c_objs)
98
 
99
#-------------------------------------------------------------------------
100
# Build Object Files from Assembly Source
101
#-------------------------------------------------------------------------
102
 
103
gloss_asm_srcs = $(filter %.S, $(gloss_srcs))
104
gloss_asm_objs = $(patsubst %.S, %.o, $(notdir $(gloss_asm_srcs)))
105
gloss_asm_deps = $(patsubst %.S, %.d, $(notdir $(gloss_asm_srcs)))
106
 
107
$(gloss_asm_objs) : %.o : %.S
108
        $(COMPILE) -c $<
109
 
110
objs += $(gloss_asm_objs)
111
deps += $(gloss_asm_deps)
112
junk += $(gloss_asm_deps) $(gloss_asm_objs)
113
 
114
#-------------------------------------------------------------------------
115
# Build libgloss.a
116
#-------------------------------------------------------------------------
117
 
118
gloss_lib  = libgloss.a
119
$(gloss_lib) : $(objs)
120
        $(AR) rcv $@ $^
121
        $(RANLIB) $@
122
 
123
junk += $(gloss_libs)
124
 
125
install_hdrs += $(gloss_hdrs)
126
install_libs += $(gloss_lib)
127
 
128
#-------------------------------------------------------------------------
129
# Build crt0.o
130
#-------------------------------------------------------------------------
131
 
132
crt0_obj  = $(patsubst %.S, %.o, $(crt0_asm))
133
crt0_deps = $(patsubst %.S, %.d, $(crt0_asm))
134
 
135
$(crt0_obj) : %.o : %.S
136
        $(COMPILE) -c $<
137
 
138
deps += $(crt0_deps)
139
junk += $(crt0_deps) $(crt0_obj)
140
 
141
install_libs += $(crt0_obj)
142
 
143
#-------------------------------------------------------------------------
144
# Linker Script
145
#-------------------------------------------------------------------------
146
# Currently we install the maven linker script in the target lib
147
# directory. This should by default be part of gcc's search path, and we
148
# have also changed mips-maven.h so that the default maven spec file
149
# always includes -Tmaven.ld on the linker command line. There is
150
# probably a better way to handle setting up the default linker script.
151
 
152
install_libs += $(addprefix $(src_dir)/, $(linker_script))
153
 
154
#-------------------------------------------------------------------------
155
# Autodependency files
156
#-------------------------------------------------------------------------
157
 
158
-include $(deps)
159
 
160
deps : $(deps)
161
.PHONY : deps
162
 
163
#-------------------------------------------------------------------------
164
# Installation
165
#-------------------------------------------------------------------------
166
 
167
install_hdrs_wdir += $(addprefix $(src_dir)/, $(install_hdrs))
168
install-hdrs : $(install_hdrs_wdir)
169
        $(MKINSTALLDIRS) $(install_hdrs_dir)
170
        for file in $^; do \
171
    $(INSTALL_HDR) $$file $(install_hdrs_dir); \
172
  done
173
 
174
install-libs : $(install_libs)
175
        $(MKINSTALLDIRS) $(install_libs_dir)
176
        for file in $^; do \
177
    $(INSTALL_LIB) $$file $(install_libs_dir); \
178
  done
179
 
180
install : install-hdrs install-libs
181
.PHONY : install install-hdrs install-libs
182
 
183
#-------------------------------------------------------------------------
184
# Regenerate configure information
185
#-------------------------------------------------------------------------
186
 
187
configure_prereq = \
188
  $(src_dir)/configure.ac \
189
 
190
$(src_dir)/configure : $(configure_prereq)
191
        cd $(src_dir) && autoconf
192
 
193
config.status : $(src_dir)/configure
194
        ./config.status --recheck
195
 
196
Makefile : $(src_dir)/Makefile.in config.status
197
        ./config.status
198
 
199
dist_junk += config.status Makefile config.log
200
 
201
#-------------------------------------------------------------------------
202
# Default
203
#-------------------------------------------------------------------------
204
 
205
all : $(install_libs)
206
.PHONY : all
207
 
208
#-------------------------------------------------------------------------
209
# Clean up junk
210
#-------------------------------------------------------------------------
211
 
212
clean :
213
        rm -rf *~ \#* $(junk)
214
 
215
distclean :
216
        rm -rf *~ \#* $(junk) $(dist_junk)
217
 
218
.PHONY : clean distclean

powered by: WebSVN 2.1.0

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