1 # Make-lang.in -- Top level -*- makefile -*- fragment for gcc BRIG (HSAIL)
4 # Copyright (C) 2015-2018 Free Software Foundation, Inc.
6 # This file is part of GCC.
8 # GCC is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3, or (at your option)
13 # GCC is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GCC; see the file COPYING3. If not see
20 # <http://www.gnu.org/licenses/>.
22 # This file provides the language dependent support in the main Makefile.
26 GCCBRIG_INSTALL_NAME := $(shell echo gccbrig|sed '$(program_transform_name)')
27 GCCBRIG_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gccbrig|sed \
28 '$(program_transform_name)')
30 # The name for selecting brig in LANGUAGES.
35 CFLAGS-brig/brigspec.o += $(DRIVER_DEFINES)
37 GCCBRIG_OBJS = $(GCC_OBJS) brig/brigspec.o
38 gccbrig$(exeext): $(GCCBRIG_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
40 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
41 $(GCCBRIG_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
42 $(EXTRA_GCC_LIBS) $(LIBS)
44 # The cross-compiler version. This is built mainly as a signal to the
45 # brig.install-common target. If this executable exists, it means that
46 # brig.all.cross was run.
47 gccbrig-cross$(exeext): gccbrig$(exeext)
48 -rm -f gccbrig-cross$(exeext)
49 cp gccbrig$(exeext) gccbrig-cross$(exeext)
51 # Use strict warnings.
52 brig-warn = $(STRICT_WARN)
56 brig/brig-code-entry-handler.o \
57 brig/brig-function-handler.o \
58 brig/brig-variable-handler.o \
59 brig/brig-fbarrier-handler.o \
60 brig/brig-label-handler.o \
61 brig/brig-comment-handler.o \
62 brig/brig-basic-inst-handler.o \
63 brig/brig-cvt-inst-handler.o \
64 brig/brig-seg-inst-handler.o \
65 brig/brig-lane-inst-handler.o \
66 brig/brig-queue-inst-handler.o \
67 brig/brig-copy-move-inst-handler.o \
68 brig/brig-signal-inst-handler.o \
69 brig/brig-atomic-inst-handler.o \
70 brig/brig-arg-block-handler.o \
71 brig/brig-control-handler.o \
72 brig/brig-cmp-inst-handler.o \
73 brig/brig-branch-inst-handler.o \
74 brig/brig-mem-inst-handler.o \
75 brig/brig-module-handler.o \
76 brig/brig-inst-mod-handler.o \
77 brig/brig-function.o \
78 brig/brig-to-generic.o \
82 brig_OBJS = $(BRIG_OBJS) brig/brigspec.o
84 # brig1$(exeext): $(BRIG_OBJS) attribs.o $(BACKEND) $(LIBDEPS)
85 # +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
86 # $(BRIG_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
89 brig1$(exeext): $(BRIG_OBJS) attribs.o $(BACKEND) $(LIBDEPS)
90 +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
91 $(BRIG_OBJS) attribs.o $(BACKEND) $(LIBS) \
98 $(gcc_docdir)/include/fdl.texi \
99 $(gcc_docdir)/include/gpl_v3.texi \
100 $(gcc_docdir)/include/gcc-common.texi \
103 doc/gccbrig.info: $(BRIG_TEXI_FILES)
104 if test "x$(BUILD_INFO)" = xinfo; then \
105 rm -f doc/gccbrig.info*; \
106 $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
107 -I $(gcc_docdir)/include -o $@ $<; \
110 doc/gccbrig.dvi: $(BRIG_TEXI_FILES)
111 $(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
113 doc/gccbrig.pdf: $(BRIG_TEXI_FILES)
114 $(TEXI2PDF) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
116 $(build_htmldir)/brig/index.html: $(BRIG_TEXI_FILES)
117 $(mkinstalldirs) $(@D)
119 $(TEXI2HTML) -I $(gcc_docdir) -I $(gcc_docdir)/include \
120 -I $(srcdir)/brig -o $(@D) $<
122 .INTERMEDIATE: gccbrig.pod
124 gccbrig.pod: brig/gccbrig.texi
125 -$(TEXI2POD) -D gccbrig < $< > $@
129 brig.all.cross: gccbrig-cross$(exeext)
130 brig.start.encap: gccbrig$(exeext)
132 brig.info: doc/gccbrig.info
133 brig.dvi: doc/gccbrig.dvi
134 brig.pdf: doc/gccbrig.pdf
135 brig.html: $(build_htmldir)/brig/index.html
136 brig.srcinfo: doc/gccbrig.info
137 -cp -p $^ $(srcdir)/doc
142 etags -o TAGS.sub *.c *.h; \
143 etags --include TAGS.sub --include ../TAGS.sub
145 brig.man: doc/gccbrig.1
146 brig.srcman: doc/gccbrig.1
147 -cp -p $^ $(srcdir)/doc
149 lang_checks += check-brig
153 brig.install-common: installdirs
154 -rm -f $(DESTDIR)$(bindir)/$(GCCBRIG_INSTALL_NAME)$(exeext)
155 $(INSTALL_PROGRAM) gccbrig$(exeext) \
156 $(DESTDIR)$(bindir)/$(GCCBRIG_INSTALL_NAME)$(exeext)
157 -if test -f brig1$(exeext); then \
158 if test -f gccbrig-cross$(exeext); then \
161 rm -f $(DESTDIR)$(bindir)/$(GCCBRIG_TARGET_INSTALL_NAME)$(exeext); \
162 ( cd $(DESTDIR)$(bindir) && \
163 $(LN) $(GCCBRIG_INSTALL_NAME)$(exeext) \
164 $(GCCBRIG_TARGET_INSTALL_NAME)$(exeext) ); \
170 brig.install-info: #$(DESTDIR)$(infodir)/gccbrig.info
172 brig.install-pdf: doc/gccbrig.pdf
174 test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
175 @for p in doc/gccbrig.pdf; do \
176 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
177 f=$(pdf__strip_dir) \
178 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
179 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
182 brig.install-html: $(build_htmldir)/brig
184 test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
185 @for p in $(build_htmldir)/brig; do \
186 if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; \
188 f=$(html__strip_dir) \
189 if test -d "$$d$$p"; then \
190 echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
191 $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
192 echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
193 $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
195 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
196 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
200 brig.install-man: $(DESTDIR)$(man1dir)/$(GCCBRIG_INSTALL_NAME)$(man1ext)
202 $(DESTDIR)$(man1dir)/$(GCCBRIG_INSTALL_NAME)$(man1ext): doc/gccbrig.1 \
205 -$(INSTALL_DATA) $< $@
209 rm -rf $(DESTDIR)$(bindir)/$(GCCBRIG_INSTALL_NAME)$(exeext)
210 rm -rf $(DESTDIR)$(man1dir)/$(GCCBRIG_INSTALL_NAME)$(man1ext)
211 rm -rf $(DESTDIR)$(bindir)/$(GCCBRIG_TARGET_INSTALL_NAME)$(exeext)
212 rm -rf $(DESTDIR)$(infodir)/gccbrig.info*
217 -rm -f brig/*$(objext)
218 -rm -f brig/*$(coverageexts)
221 brig.maintainer-clean:
222 -rm -f $(docobjdir)/gccbrig.1
226 brig.stage1: stage1-start
227 -mv brig/*$(objext) stage1/brig
228 brig.stage2: stage2-start
229 -mv brig/*$(objext) stage2/brig
230 brig.stage3: stage3-start
231 -mv brig/*$(objext) stage3/brig
232 brig.stage4: stage4-start
233 -mv brig/*$(objext) stage4/brig
234 brig.stageprofile: stageprofile-start
235 -mv brig/*$(objext) stageprofile/brig
236 brig.stagefeedback: stagefeedback-start
237 -mv brig/*$(objext) stagefeedback/brig
239 CFLAGS-brig/brig-lang.o += -DDEFAULT_TARGET_VERSION=\"$(version)\" \
240 -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\"
242 BRIGINCLUDES = -I $(srcdir)/brig -I ${HOME}/local/include \
243 -I $(srcdir)/brig/brigfrontend
245 brig/brig-machine.o: brig/brigfrontend/brig-machine.c
246 $(COMPILE) $(BRIGINCLUDES) $<
249 brig/%.o: brig/brigfrontend/%.cc
250 $(COMPILE) $(BRIGINCLUDES) $<