1 | # |
---|
2 | # Copyright (C) 2006 KPIT Cummins |
---|
3 | # Copyright (C) 2009 Conny Marco Menebröcker |
---|
4 | # All rights reserved. |
---|
5 | # |
---|
6 | # Redistribution and use in source and binary forms is permitted |
---|
7 | # provided that the above copyright notice and following paragraph are |
---|
8 | # duplicated in all such forms. |
---|
9 | # |
---|
10 | # This file is distributed WITHOUT ANY WARRANTY; without even the implied |
---|
11 | # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
---|
12 | # |
---|
13 | |
---|
14 | DESTDIR = |
---|
15 | VPATH = @srcdir@ |
---|
16 | srcdir = @srcdir@ |
---|
17 | objdir = . |
---|
18 | srcroot = $(srcdir)/../.. |
---|
19 | objroot = $(objdir)/../.. |
---|
20 | |
---|
21 | prefix = @prefix@ |
---|
22 | exec_prefix = @exec_prefix@ |
---|
23 | |
---|
24 | host_alias = @host_alias@ |
---|
25 | target_alias = @target_alias@ |
---|
26 | program_transform_name = @program_transform_name@ |
---|
27 | |
---|
28 | bindir = @bindir@ |
---|
29 | libdir = @libdir@ |
---|
30 | tooldir = $(exec_prefix)/$(target_alias) |
---|
31 | |
---|
32 | # Multilib support variables. |
---|
33 | # TOP is used instead of MULTI{BUILD,SRC}TOP. |
---|
34 | MULTIDIRS = |
---|
35 | MULTISUBDIR = |
---|
36 | MULTIDO = true |
---|
37 | MULTICLEAN = true |
---|
38 | |
---|
39 | INSTALL = @INSTALL@ |
---|
40 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
41 | INSTALL_DATA = @INSTALL_DATA@ |
---|
42 | |
---|
43 | SHELL = /bin/sh |
---|
44 | |
---|
45 | CC = @CC@ |
---|
46 | |
---|
47 | #AS = @AS@ |
---|
48 | AS = `if [ -f ${objroot}/../gas/as.new ] ; \ |
---|
49 | then echo ${objroot}/../gas/as.new ; \ |
---|
50 | else echo as ; fi` |
---|
51 | |
---|
52 | AR = @AR@ |
---|
53 | |
---|
54 | #LD = @LD@ |
---|
55 | LD = `if [ -f ${objroot}/../ld/ld.new ] ; \ |
---|
56 | then echo ${objroot}/../ld/ld.new ; \ |
---|
57 | else echo ld ; fi` |
---|
58 | |
---|
59 | RANLIB = @RANLIB@ |
---|
60 | |
---|
61 | OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \ |
---|
62 | then echo ${objroot}/../binutils/objdump ; \ |
---|
63 | else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi` |
---|
64 | OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \ |
---|
65 | then echo ${objroot}/../binutils/objcopy ; \ |
---|
66 | else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi` |
---|
67 | |
---|
68 | CRT0 = crt0.o |
---|
69 | |
---|
70 | # Generic object files common to all targets. |
---|
71 | GENOBJS_NO_TRAP = close.o create.o crt0.o fstat.o getchar1.o \ |
---|
72 | isatty.o lseek.o mem-layout.o misc.o open.o \ |
---|
73 | read.o sbrk.o syscalls.o write.o |
---|
74 | GENOBJS = ${GENOBJS_NO_TRAP} trap_handle.o |
---|
75 | |
---|
76 | # Object files specific to particular targets. |
---|
77 | EVALOBJS = ${GENOBJS} |
---|
78 | CYGMONOBJS = ${GENOBJS_NO_TRAP} |
---|
79 | |
---|
80 | CFLAGS = -g |
---|
81 | |
---|
82 | GCC_LDFLAGS = `if [ -d ${objroot}/../gcc ] ; \ |
---|
83 | then echo -L${objroot}/../gcc ; fi` |
---|
84 | |
---|
85 | SCRIPTS = @script_list@ |
---|
86 | BSP = @bsp_list@ |
---|
87 | |
---|
88 | # Host specific makefile fragment comes in here. |
---|
89 | @host_makefile_frag@ |
---|
90 | |
---|
91 | # |
---|
92 | # build a test program for each target board. Just trying to get |
---|
93 | # it to link is a good test, so we ignore all the errors for now. |
---|
94 | # |
---|
95 | |
---|
96 | all: ${CRT0} ${BSP} |
---|
97 | |
---|
98 | # |
---|
99 | # here's where we build the board support packages for each target |
---|
100 | # |
---|
101 | |
---|
102 | libeval.a: $(EVALOBJS) |
---|
103 | ${AR} ${ARFLAGS} $@ $(EVALOBJS) |
---|
104 | ${RANLIB} $@ |
---|
105 | |
---|
106 | libcygmon.a: $(CYGMONOBJS) |
---|
107 | ${AR} ${ARFLAGS} $@ $(CYGMONOBJS) |
---|
108 | ${RANLIB} $@ |
---|
109 | |
---|
110 | |
---|
111 | doc: |
---|
112 | |
---|
113 | clean mostlyclean: |
---|
114 | rm -f a.out core *.i *~ *.o *-test *.srec *.dis *.map *.x |
---|
115 | |
---|
116 | distclean maintainer-clean realclean: clean |
---|
117 | rm -f Makefile config.status a.out |
---|
118 | |
---|
119 | .PHONY: install info install-info clean-info |
---|
120 | install: |
---|
121 | @for crt in ${CRT0}; do \ |
---|
122 | $(INSTALL_PROGRAM) $${crt} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$${crt}; \ |
---|
123 | done |
---|
124 | @for bsp in ${BSP}; do \ |
---|
125 | $(INSTALL_PROGRAM) $${bsp} $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}; \ |
---|
126 | done |
---|
127 | @for script in ${SCRIPTS}; do \ |
---|
128 | $(INSTALL_DATA) ${srcdir}/$${script}.ld $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$${script}.ld; \ |
---|
129 | done |
---|
130 | |
---|
131 | info: |
---|
132 | install-info: |
---|
133 | clean-info: |
---|
134 | |
---|
135 | # these are for the BSPs |
---|
136 | crt0.o: ${srcdir}/crt0.S |
---|
137 | |
---|
138 | # target specific makefile fragment comes in here. |
---|
139 | @target_makefile_frag@ |
---|
140 | |
---|
141 | Makefile: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@ |
---|
142 | $(SHELL) config.status |
---|
143 | |
---|
144 | config.status: configure |
---|
145 | $(SHELL) config.status --recheck |
---|