1 # Make-lang.in -- Top level -*- makefile -*- fragment for gcc BRIG (HSAIL)
4 # Copyright (C) 2015-2017 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) $<
124 brig.all.cross: gccbrig-cross$(exeext)
125 brig.start.encap: gccbrig$(exeext)
127 #brig.info: doc/gccbrig.info
129 brig.dvi: doc/gccbrig.dvi
130 brig.pdf: doc/gccbrig.pdf
131 brig.html: $(build_htmldir)/brig/index.html
132 brig.srcinfo: #doc/gccbrig.info
133 # -cp -p $^ $(srcdir)/doc
138 etags -o TAGS.sub *.c *.h; \
139 etags --include TAGS.sub --include ../TAGS.sub
142 #brig.srcman: doc/gccbrig.1
143 # -cp -p $^ $(srcdir)/doc
145 lang_checks += check-brig
149 brig.install-common: installdirs
150 -rm -f $(DESTDIR)$(bindir)/$(GCCBRIG_INSTALL_NAME)$(exeext)
151 $(INSTALL_PROGRAM) gccbrig$(exeext) \
152 $(DESTDIR)$(bindir)/$(GCCBRIG_INSTALL_NAME)$(exeext)
153 -if test -f brig1$(exeext); then \
154 if test -f gccbrig-cross$(exeext); then \
157 rm -f $(DESTDIR)$(bindir)/$(GCCBRIG_TARGET_INSTALL_NAME)$(exeext); \
158 ( cd $(DESTDIR)$(bindir) && \
159 $(LN) $(GCCBRIG_INSTALL_NAME)$(exeext) \
160 $(GCCBRIG_TARGET_INSTALL_NAME)$(exeext) ); \
166 brig.install-info: #$(DESTDIR)$(infodir)/gccbrig.info
168 brig.install-pdf: doc/gccbrig.pdf
170 test -z "$(pdfdir)" || $(mkinstalldirs) "$(DESTDIR)$(pdfdir)/gcc"
171 @for p in doc/gccbrig.pdf; do \
172 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
173 f=$(pdf__strip_dir) \
174 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(pdfdir)/gcc/$$f'"; \
175 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(pdfdir)/gcc/$$f"; \
178 brig.install-html: $(build_htmldir)/brig
180 test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
181 @for p in $(build_htmldir)/brig; do \
182 if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; \
184 f=$(html__strip_dir) \
185 if test -d "$$d$$p"; then \
186 echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
187 $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
188 echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
189 $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
191 echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
192 $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
196 brig.install-man: #$(DESTDIR)$(man1dir)/$(GCCBRIG_INSTALL_NAME)$(man1ext)
198 #$(DESTDIR)$(man1dir)/$(GCCBRIG_INSTALL_NAME)$(man1ext): doc/gccbrig.1 \
201 # -$(INSTALL_DATA) $< $@
205 rm -rf $(DESTDIR)$(bindir)/$(GCCBRIG_INSTALL_NAME)$(exeext)
206 rm -rf $(DESTDIR)$(man1dir)/$(GCCBRIG_INSTALL_NAME)$(man1ext)
207 rm -rf $(DESTDIR)$(bindir)/$(GCCBRIG_TARGET_INSTALL_NAME)$(exeext)
208 rm -rf $(DESTDIR)$(infodir)/gccbrig.info*
213 -rm -f brig/*$(objext)
214 -rm -f brig/*$(coverageexts)
217 brig.maintainer-clean:
218 -rm -f $(docobjdir)/gccbrig.1
222 brig.stage1: stage1-start
223 -mv brig/*$(objext) stage1/brig
224 brig.stage2: stage2-start
225 -mv brig/*$(objext) stage2/brig
226 brig.stage3: stage3-start
227 -mv brig/*$(objext) stage3/brig
228 brig.stage4: stage4-start
229 -mv brig/*$(objext) stage4/brig
230 brig.stageprofile: stageprofile-start
231 -mv brig/*$(objext) stageprofile/brig
232 brig.stagefeedback: stagefeedback-start
233 -mv brig/*$(objext) stagefeedback/brig
235 CFLAGS-brig/brig-lang.o += -DDEFAULT_TARGET_VERSION=\"$(version)\" \
236 -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\"
238 BRIGINCLUDES = -I $(srcdir)/brig -I ${HOME}/local/include \
239 -I $(srcdir)/brig/brigfrontend
241 brig/brig-machine.o: brig/brigfrontend/brig-machine.c
242 $(COMPILE) $(BRIGINCLUDES) $<
245 brig/%.o: brig/brigfrontend/%.cc
246 $(COMPILE) $(BRIGINCLUDES) $<