Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Makefile.inc « sparc « libgloss - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 707c06428530a872e0902354abeb180340dae74f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
## Copyright (c) 1995, 1996, 1997 Cygnus Support
##
## The authors hereby grant permission to use, copy, modify, distribute,
## and license this software and its documentation for any purpose, provided
## that existing copyright notices are retained in all copies and that this
## notice is included verbatim in any distributions. No written agreement,
## license, or royalty fee is required for any of the authorized uses.
## Modifications to this software may be copyrighted by their authors
## and need not follow the licensing terms described here, provided that
## the new terms are clearly indicated on the first page of each file where
## they apply.

## This is set to one of SPARC, SLITE, or SPLET by configure.
## It's not clear what to do here.
## One could certainly build everything.  The assembler supports all cpu
## variants (via runtime switches).  However, the compiler [currently] doesn't.
## Of course, it may be the case that there isn't any cpu specific code in
## C source files, but there might be in the future.
AM_CPPFLAGS_%C% = -DTARGET_CPU_$(SPARC_CPU)

multilibtool_DATA += %D%/crt0.o
libobjs_a_SOURCES += %D%/crt0.S

## Used by some libs.
%C%_common_stub_sources = \
	close.c \
	fstat.c \
	getpid.c \
	isatty.c \
	kill.c \
	lseek.c \
	open.c \
	print.c \
	putnum.c \
	read.c \
	sbrk.c \
	stat.c \
	unlink.c \
	write.c

## ERC32: SIS simulator, see sim/erc32.
multilibtool_DATA += %D%/erc32-crt0.o
libobjs_a_SOURCES += %D%/erc32-crt0.S
multilibtool_LIBRARIES += %D%/liberc32.a
%C%_liberc32_a_SOURCES = \
	$(%C%_common_stub_sources) \
	%D%/erc32-io.c \
	%D%/traps.S \
	%D%/erc32-stub.c \
	debug.c \
	%D%/fixctors.c

if SPARC_BUILD_CYGMON
## sparc stuff (not sparclite or sparclet).
%C%_SPARC_OBJ_FORMAT = sparc
%C%_SPARC_RAM_START = 0x4000

## sparc 64 stuff.
%C%_SPARC64_OBJ_FORMAT = sparc:v9
%C%_SPARC64_RAM_START = 0x4000

## sparclite stuff.
%C%_SLITE_OBJ_FORMAT = sparc
%C%_SLITE_RAM_START = 0x40050000

multilibtool_DATA += %D%/cygmon.ld
%D%/cygmon.ld: $(srcdir)/%D%/@SPARC_CYGMONLDSCRIPTTEMPL@ %D%/Makefile.inc
	$(AM_V_GEN)sed 's/TARGET_OBJ_FORMAT/$(%C%_$(SPARC_CPU)_OBJ_FORMAT)/g;s/TARGET_RAM_START/$(%C%_$(SPARC_CPU)_RAM_START)/g;' < $< > $@

multilibtool_DATA += %D%/cygmon-crt0.o
libobjs_a_SOURCES += %D%/cygmon-crt0.S
multilibtool_LIBRARIES += %D%/libcygmon.a
%C%_libcygmon_a_SOURCES = \
	%D%/cygmon-salib.c
multilibtool_DATA += %D%/cygmon-salib.o
endif

if SPARC_BUILD_SLITE
multilibtool_DATA += \
	%D%/ex930.ld \
	%D%/ex931.ld \
	%D%/ex934.ld \
	%D%/sparc86x.ld \
	%D%/elfsim.ld \
	%D%/traps.o

## For the time being, built the stub without hardware breakpoint support.
multilibtool_LIBRARIES += \
	%D%/libslite930.a \
	%D%/libslite931.a \
	%D%/libslite934.a \
	%D%/libslite86x.a
%C%_libslite930_a_SOURCES = \
	$(%C%_common_stub_sources) \
	%D%/salib.c \
	%D%/sparcl-stub.c \
	%D%/cache.c
%C%_libslite931_a_SOURCES = $(%C%_libslite930_a_SOURCES)
%C%_libslite934_a_SOURCES = $(%C%_libslite930_a_SOURCES)
%C%_libslite86x_a_SOURCES = $(%C%_libslite930_a_SOURCES)
endif

if SPARC_BUILD_SPLET
multilibtool_DATA += %D%/tsc701.ld

multilibtool_DATA += %D%/crt0-701.S
libobjs_a_SOURCES += %D%/crt0-701.S

multilibtool_LIBRARIES += %D%/libsplet701.a
%C%_libsplet701_a_SOURCES = \
	%D%/sysc-701.c \
	%D%/salib-701.c \
	%D%/sparclet-stub.c
endif

## Compile a fully linked binary. The -N option is for a.out, so the
## base address will be zero, rather than the default of 0x2020. The
## -Wl,-T*.ld is for the linker script. By using -Wl, the linker script
## is put on the proper place in the comand line for ld, and all the
## symbols will get fully resolved.

check_PROGRAMS += %D%/erc32-test
%C%_erc32_test_SOURCES = %D%/test.c
AM_LDFLAGS_%C%_erc32_test = -N -Wl,-T$(srcdir)/%D%/elfsim.ld -Wl,-Map,$@.map -nostdlib

check_PROGRAMS += %D%/ex930-test
%C%_ex930_test_SOURCES = %D%/test.c
AM_LDFLAGS_%C%_ex930_test = -N -Wl,-T$(srcdir)/%D%/ex930.ld -nostdlib

check_PROGRAMS += %D%/ex931-test
%C%_ex931_test_SOURCES = %D%/test.c
AM_LDFLAGS_%C%_ex931_test = -N -Wl,-T$(srcdir)/%D%/ex931.ld -nostdlib

check_PROGRAMS += %D%/ex934-test
%C%_ex934_test_SOURCES = %D%/test.c
AM_LDFLAGS_%C%_ex934_test = -N -Wl,-T$(srcdir)/%D%/ex934.ld -nostdlib

## A C++ test case.
# check_PROGRAMS += %D%/dtor
# %C%_ex934_test_SOURCES = %D%/dtor.C
# %C%_ex934_test_LDFLAGS = $(AM_LDFLAGS) -N -Wl,-T$(srcdir)/%D%/elfsim.ld -nostdlib