1 | # Makefile for libgloss/sparc_leon. This is the board support |
---|
2 | # code for the various sparc leon targets. |
---|
3 | |
---|
4 | DESTDIR = |
---|
5 | VPATH = @srcdir@ |
---|
6 | srcdir = @srcdir@ |
---|
7 | objdir = . |
---|
8 | srcroot = $(srcdir)/../.. |
---|
9 | objroot = $(objdir)/../.. |
---|
10 | |
---|
11 | prefix = @prefix@ |
---|
12 | exec_prefix = @exec_prefix@ |
---|
13 | |
---|
14 | host_alias = @host_alias@ |
---|
15 | target_alias = @target_alias@ |
---|
16 | |
---|
17 | bindir = @bindir@ |
---|
18 | libdir = @libdir@ |
---|
19 | tooldir = $(exec_prefix)/$(target_alias) |
---|
20 | mkinstalldirs = $(SHELL) $(srcroot)/mkinstalldirs |
---|
21 | |
---|
22 | # Multilib support variables. |
---|
23 | # TOP is used instead of MULTI{BUILD,SRC}TOP. |
---|
24 | MULTIDIRS = |
---|
25 | MULTISUBDIR = |
---|
26 | MULTIDO = true |
---|
27 | MULTICLEAN = true |
---|
28 | |
---|
29 | INSTALL = @INSTALL@ |
---|
30 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
31 | INSTALL_DATA = @INSTALL_DATA@ |
---|
32 | |
---|
33 | SHELL = /bin/sh |
---|
34 | |
---|
35 | CC = @CC@ |
---|
36 | |
---|
37 | AS = @AS@ |
---|
38 | AR = @AR@ |
---|
39 | LD = @LD@ |
---|
40 | RANLIB = @RANLIB@ |
---|
41 | AR_FLAGS = qrv |
---|
42 | |
---|
43 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ |
---|
44 | then echo ${objroot}/../binutils/objdump ; \ |
---|
45 | else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` |
---|
46 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ |
---|
47 | then echo ${objroot}/../binutils/objcopy ; \ |
---|
48 | else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` |
---|
49 | |
---|
50 | LEON_BSP = libleonbare.a |
---|
51 | LEON_OBJS = etrap.o rtrap.o etrap_fast.o rtrap_fast.o irqinstall.o regwin.o \ |
---|
52 | regwinflush.o fpu.o bdinit.o contextswitch.o \ |
---|
53 | busscan.o irqtrap_fast.o catch_interrupt.o catch_interrupt_svt.o \ |
---|
54 | catch_interrupt_mvt.o catch_interrupt_pending.o gettimeofday.o \ |
---|
55 | times.o rtc.o lcpuinit.o console_init.o console.o console_dbg.o \ |
---|
56 | contextswitch.o contextswitch_asm.o _exit.o amba.o amba_dbg.o \ |
---|
57 | amba_scan.o amba_driver.o timer.o mutex.o locore.o locore_clean.o \ |
---|
58 | locore_var.o locore_var_svt.o jiffies.o \ |
---|
59 | mmu_asm.o locore_svtdisp.o locore_mvt_reset.o locore_svt_reset.o stop.o initcalls.o \ |
---|
60 | regwin_patch.o cacheA.o nocache.o |
---|
61 | |
---|
62 | LEONBARE_THREADS = liblbthread.a |
---|
63 | LEONBARE_THREADS_OBJS = kernel.o kernel_debug.o kernel_debug_var.o kernel_context.o \ |
---|
64 | kernel_mutex.o kernel_thread.o kernel_sched.o kernel_queue.o \ |
---|
65 | kernel_mm.o |
---|
66 | |
---|
67 | LOCOREATEXIT = locore_atexit.o |
---|
68 | LEON_SMALLC = libsmall.a |
---|
69 | |
---|
70 | PNP=pnpinit.o |
---|
71 | PNP_S=pnpinit_simple.o |
---|
72 | LEON_ALL = $(LEON_BSP) $(LEON_SMALLC) $(LEONBARE_THREADS) $(PNP) $(PNP_S) crti.o crtn.o |
---|
73 | |
---|
74 | LOCORESVT = locore_svt.o |
---|
75 | LOCOREMVT = locore_mvt.o |
---|
76 | CRT0 = crt0.o |
---|
77 | OBJS = close.o fstat.o getpid.o isatty.o kill.o \ |
---|
78 | lseek.o open.o print.o putnum.o read.o sbrk.o stat.o \ |
---|
79 | unlink.o write.o io.o kernel.o kernel_debug.o kernel_debug_var.o kernel_context.o |
---|
80 | #link.o |
---|
81 | |
---|
82 | #### Host specific Makefile fragment comes in here. |
---|
83 | @host_makefile_frag@ |
---|
84 | |
---|
85 | all: stmp-targ-include $(CRT0) $(LOCOREMVT) $(LOCORESVT) $(LEON_ALL) |
---|
86 | |
---|
87 | $(CRT0): $(srcdir)/crt0.S |
---|
88 | $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS) $(INCLUDES) -o $@ -c $(srcdir)/crt0.S |
---|
89 | |
---|
90 | $(LEON_BSP): $(OBJS) $(LEON_OBJS) |
---|
91 | @rm -f $@ |
---|
92 | ${AR} ${AR_FLAGS} $@ $(OBJS) $(LEON_OBJS) |
---|
93 | ${RANLIB} $@ |
---|
94 | |
---|
95 | $(LEON_SMALLC): $(LOCOREATEXIT) |
---|
96 | @rm -f $@ |
---|
97 | ${AR} ${AR_FLAGS} $@ $(LOCOREATEXIT) |
---|
98 | ${RANLIB} $@ |
---|
99 | |
---|
100 | $(LEONBARE_THREADS): $(LEONBARE_THREADS_OBJS) |
---|
101 | @rm -f $@ |
---|
102 | ${AR} ${AR_FLAGS} $@ $(LEONBARE_THREADS_OBJS) |
---|
103 | ${RANLIB} $@ |
---|
104 | |
---|
105 | install: |
---|
106 | $(INSTALL_DATA) $(CRT0) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(CRT0) |
---|
107 | $(INSTALL_DATA) $(LOCORESVT) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(LOCORESVT) |
---|
108 | $(INSTALL_DATA) $(LOCOREMVT) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(LOCOREMVT) |
---|
109 | $(INSTALL_DATA) $(PNP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(PNP) |
---|
110 | $(INSTALL_DATA) $(PNP_S) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(PNP_S) |
---|
111 | $(INSTALL_DATA) $(LEON_BSP) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(LEON_BSP) |
---|
112 | $(INSTALL_DATA) $(LEON_SMALLC) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(LEON_SMALLC) |
---|
113 | $(INSTALL_DATA) $(LEONBARE_THREADS) $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$(LEONBARE_THREADS) |
---|
114 | if [ -z "$(MULTISUBDIR)" ]; then \ |
---|
115 | $(mkinstalldirs) $(DESTDIR)$(tooldir)/include/asm-leon; \ |
---|
116 | for i in $(srcdir)/asm-leon/*.h; do \ |
---|
117 | if [ -f $$i ]; then \ |
---|
118 | $(INSTALL_DATA) $$i $(DESTDIR)$(tooldir)/include/asm-leon/`basename $$i` || exit $$?; \ |
---|
119 | else true; fi ; \ |
---|
120 | done; \ |
---|
121 | else true; fi |
---|
122 | |
---|
123 | stmp-targ-include: $(srcdir)/asm-leon/* |
---|
124 | if [ -d ${objroot}/newlib/targ-include/asm-leon ]; then \ |
---|
125 | rm -rf ${objroot}/newlib/targ-include/asm-leon; \ |
---|
126 | else true; fi ; \ |
---|
127 | if [ -d ${objroot}/newlib/targ-include ]; then \ |
---|
128 | cp -r $(srcdir)/asm-leon ${objroot}/newlib/targ-include/asm-leon; \ |
---|
129 | else true; fi ; \ |
---|
130 | touch $@ |
---|
131 | |
---|
132 | all-recursive: stmp-targ-include |
---|
133 | |
---|
134 | # Make a simple test case to test the linker script, startup code, and |
---|
135 | # I/O code |
---|
136 | # |
---|
137 | test: |
---|
138 | @echo Done... |
---|
139 | |
---|
140 | # target specific makefile fragment comes in here. |
---|
141 | # @target_makefile_frag@ |
---|
142 | |
---|
143 | clean mostlyclean: |
---|
144 | rm -f *.o *.a *.map *.x |
---|
145 | |
---|
146 | distclean maintainer-clean realclean: clean |
---|
147 | rm -f Makefile config.cache config.log config.status |
---|
148 | |
---|
149 | .PHONY: info dvi doc install-info clean-info |
---|
150 | info doc dvi: |
---|
151 | install-info: |
---|
152 | clean-info: |
---|
153 | |
---|
154 | # target specific makefile fragment comes in here. |
---|
155 | @target_makefile_frag@ |
---|
156 | |
---|
157 | Makefile: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@ |
---|
158 | $(SHELL) config.status |
---|
159 | |
---|
160 | config.status: configure |
---|
161 | $(SHELL) config.status --recheck |
---|