Commit | Line | Data |
---|---|---|
2fa0b342 DHW |
1 | # |
2 | # Makefile for ld version 2 | |
3 | # | |
4 | # $Id$ | |
5 | # | |
6 | srcdir = . | |
7 | BASEDIR = ../.. | |
8 | ||
9 | INCLUDE = $(srcdir)/$(BASEDIR)/include-cygnus | |
10 | INCLUDES = -I$(srcdir) -I$(INCLUDE) | |
11 | DEBUG = -g | |
12 | CFLAGS = $(INCLUDES) $(DEBUG) | |
13 | ||
14 | # go directly to ld.new in case this ld isn't capable of | |
15 | # linking native object on this host. It can be renamed on | |
16 | # install. | |
17 | PROGS = ld.new | |
18 | ||
19 | # for self hosting | |
20 | GNUTARGET=a.out-generic-big | |
21 | LDEMULATION=gld | |
22 | bfdlib=$(srcdir)/$(BASEDIR)/bfd/$(HOST)/libbfd.a | |
23 | ||
24 | OBJS= ldgram.o ldlex.o ldlang.o ldmain.o ldwrite.o ldexp.o ld-lnk960.o \ | |
25 | ld-gld.o ld-gld960.o ld-emul.o ldversion.o ldmisc.o ldsym.o ldfile.o | |
26 | ||
27 | HEADERS=config.h ldmain.h ldmain.h ldmisc.h ldsym.h ldlang.h ldexp.h \ | |
28 | ldlex.h ldwrite.h ldversion.h ld-emul.h ldfile.h ldgram.h ld.h | |
29 | ||
30 | MANSOURCES=ld.tex | |
31 | ||
32 | LDCSOURCES=ldlang.c ldmain.c ldwrite.c ld-lnk960.c ld-gld.c \ | |
33 | ld-gld960.c ld-emul.c ldversion.c ldmisc.c ldexp.c ldsym.c ldfile.c | |
34 | ||
35 | GENERATED_SOURCES=ldgram.tab.c ldlex.c | |
36 | GENERATED_HEADERS=ldgram.tab.h | |
37 | ||
38 | LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l | |
39 | ||
40 | #BFDSOURCES=../bfd/libbfd.c ../bfd/bfd.c ../bfd/sunos.c ../bfd/icoff.c ../bfd/b.out.c ../bfd/archive.c ../bfd/srec.c | |
41 | ||
42 | SOURCES= $(LDSOURCES) $(BFDSOURCES) | |
43 | LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES) | |
44 | ||
45 | all: $(PROGS) | |
46 | ||
47 | $(PROGS): $(OBJS) | |
48 | # (cd ../bfd; make) | |
49 | # LDEMULATION=gld; export LDEMULATION; GNUTARGET=a.out-generic-big;./ldok -format a.out-generic-big -o ld /lib/crt0.o $(OBJS) $(bfdlib) -lc /usr/local/lib/gcc/sparc/1.91/gnulib | |
50 | # gld -o ld /lib/crt0.o $(OBJS) $(bfdlib) -lc /usr/local/lib/gcc/sparc/1.91/gnulib | |
51 | $(CC) -Bstatic -o ld.new $(OBJS) $(bfdlib) | |
52 | ||
53 | ||
54 | ld1: ld | |
55 | gcc -v -B./ -o ld1 $(OBJS) $(bfdlib) | |
56 | ||
57 | ld2: ld1 | |
58 | mv ld1 ld | |
59 | gcc -v -B./ -o ld2 $(OBJS) $(bfdlib) | |
60 | ||
61 | ld3: ld2 | |
62 | mv ld2 ld | |
63 | gcc -v -B./ -o ld3 $(OBJS) $(bfdlib) | |
64 | ||
65 | ld.dvi:ld.tex | |
66 | tex ld.tex | |
67 | ||
68 | ldgram.o:ldgram.y | |
69 | yacc -d ldgram.y | |
70 | mv y.tab.c ldgram.tab.c | |
71 | $(CC) -c $(CFLAGS) ldgram.tab.c | |
72 | mv ldgram.tab.o ldgram.o | |
73 | ||
74 | ldgram.tab.h:ldgram.o | |
75 | cp y.tab.h ldgram.tab.h | |
76 | ||
77 | ldlex.c: ldlex.l ldgram.tab.h | |
78 | ldlex.o: ldlex.c ldgram.tab.h | |
79 | ||
80 | ldmain.o: ldmain.c | |
81 | ldversion.o: ldversion.c | |
82 | ldfile.o: ldfile.c | |
83 | ldwrite.o: ldwrite.c | |
84 | ldlang.o: ldlang.c ldgram.tab.h | |
85 | ld-gld.o: ld-gld.c | |
86 | ld-gld960.o: ld-gld960.c | |
87 | ld-emul.o:ld-emul.c | |
88 | ld-lnk960.o:ld-lnk960.c | |
89 | ldexp.o:ldexp.c ldgram.tab.h | |
90 | ldmisc.o:ldmisc.c | |
91 | ldsym.o:ldsym.c | |
92 | ||
93 | clean: | |
94 | - rm -f $(OBJS) $(GENERATED_SOURCES) $(GENERATED_HEADERS) | |
95 | - rm -f ld ld1 ld2 | |
96 | ||
97 | lintlog:$(SOURCES) Makefile | |
98 | $(LINT) -abhxzn $(CFLAGS) $(LINTSOURCES) \ | |
99 | | grep -v "pointer casts may be troublesome" \ | |
100 | | grep -v "possible pointer alignment problem" \ | |
101 | | grep -v "ignore" \ | |
102 | | grep -v "conversion from long may lose accuracy" \ | |
103 | | grep -v "warning: constant argument to NOT" \ | |
104 | | grep -v "enumeration type clash, operator CAST" \ | |
105 | | grep -v "warning: constant in conditional context"\ | |
106 | | grep -v "archive\.c" | |
107 | ||
108 | ||
109 | tags TAGS:$(SOURCES) $(HEADERS) | |
110 | etags -t $(SOURCES) $(HEADERS) | |
111 | ||
112 | release: | |
113 | (cd /4/steve/ld; tar cf - $(LDSOURCES) $(HEADERS) $(MANSOURCES)) | tar xf - | |
114 | ||
115 | objdump:objdump.c | |
116 | ||
117 | install: $(PROGS) | |
118 | rm -f $G960BASE/bin/$(PROGS) | |
119 | cp $(PROGS) $$G960BASE/bin/gld960c | |
120 | ||
121 | #----------------------------------------------------------------------------- | |
122 | # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT | |
123 | # | |
124 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
125 | #----------------------------------------------------------------------------- | |
126 | ||
127 | ver960.c: FORCE | |
128 | rm -f ver960.c | |
129 | echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c | |
130 | ||
131 | ||
132 | # This target should be invoked before building a new release. | |
133 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
134 | # | |
135 | roll: | |
136 | @V=`cat VERSION` ; \ | |
137 | MAJ=`sed 's/\..*//' VERSION` ; \ | |
138 | MIN=`sed 's/.*\.//' VERSION` ; \ | |
139 | V=$$MAJ.`expr $$MIN + 1` ; \ | |
140 | rm -f VERSION ; \ | |
141 | echo $$V >VERSION ; \ | |
142 | echo Version $$V | |
143 | ||
144 | # Dummy target to force execution of dependent targets. | |
145 | # | |
146 | .force: | |
147 | FORCE: | |
148 | ||
149 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
150 | # have the following string beginning in column 1: #__<hostname>__# | |
151 | # Original Makefile is backed up as 'Makefile.old'. | |
152 | # | |
153 | # Invoke with: make make HOST=xxx | |
154 | # | |
155 | make: | |
156 | -@if test $(HOST)x = x ; then \ | |
157 | echo '\aSpecify "make make HOST=???"'; \ | |
158 | exit 1; \ | |
159 | fi ; \ | |
160 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
161 | if test $$? = 0 ; then \ | |
162 | echo "\aMakefile has already been processed with 'make make'";\ | |
163 | exit 1; \ | |
164 | fi ; \ | |
165 | mv -f Makefile Makefile.old; \ | |
166 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
167 | echo "HOST=$(HOST)" >>Makefile ; \ | |
168 | echo >>Makefile ; \ | |
169 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
170 | ||
171 | #\f | |
172 | ||
173 | Makefile: ../common/Makefile | |
174 | mv Makefile Makefile.backup | |
175 | cp ../common/Makefile . | |
176 | $(MAKE) "HOST=$(HOST)" make | |
177 | ||
178 | ### Local Variables: *** | |
179 | ### mode:fundamental *** | |
180 | ### page-delimiter: "^#\f" *** | |
181 | ### End: *** | |
182 | ### end of file |