131 lines
3.6 KiB
Makefile
131 lines
3.6 KiB
Makefile
# Top level -*- makefile -*- fragment for the Elna frontend.
|
|
# Copyright (C) 2025 Free Software Foundation, Inc.
|
|
|
|
# GCC is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3, or (at your option)
|
|
# any later version.
|
|
|
|
# GCC is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with GCC; see the file COPYING3. If not see
|
|
# <http://www.gnu.org/licenses/>.
|
|
|
|
ELNA_INSTALL_NAME := $(shell echo gelna|sed '$(program_transform_name)')
|
|
ELNA_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gelna|sed '$(program_transform_name)')
|
|
|
|
elna: elna1$(exeext)
|
|
|
|
.PHONY: elna
|
|
|
|
# Driver
|
|
|
|
ELNA_OBJS = \
|
|
$(GCC_OBJS) \
|
|
elna/elna-spec.o \
|
|
$(END)
|
|
|
|
gelna$(exeext): $(ELNA_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
|
|
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
|
|
$(ELNA_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
|
|
$(EXTRA_GCC_LIBS) $(LIBS)
|
|
|
|
# The compiler proper
|
|
|
|
elna_OBJS = \
|
|
elna/elna1.o \
|
|
elna/elna-generic.o \
|
|
elna/elna-diagnostic.o \
|
|
elna/elna-tree.o \
|
|
elna/elna-builtins.o \
|
|
elna/ast.o \
|
|
elna/driver.o \
|
|
elna/lexer.o \
|
|
elna/parser.o \
|
|
elna/result.o \
|
|
$(END)
|
|
|
|
elna1$(exeext): attribs.o $(elna_OBJS) $(BACKEND) $(LIBDEPS)
|
|
+$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
|
|
attribs.o $(elna_OBJS) $(BACKEND) $(LIBS) $(BACKENDLIBS)
|
|
|
|
elna.all.cross:
|
|
|
|
elna.start.encap: gelna$(exeext)
|
|
elna.rest.encap:
|
|
|
|
# No elna-specific selftests.
|
|
selftest-elna:
|
|
|
|
elna.install-common: installdirs
|
|
-rm -f $(DESTDIR)$(bindir)/$(ELNA_INSTALL_NAME)$(exeext)
|
|
$(INSTALL_PROGRAM) gelna$(exeext) $(DESTDIR)$(bindir)/$(ELNA_INSTALL_NAME)$(exeext)
|
|
rm -f $(DESTDIR)$(bindir)/$(ELNA_TARGET_INSTALL_NAME)$(exeext); \
|
|
( cd $(DESTDIR)$(bindir) && \
|
|
$(LN) $(ELNA_INSTALL_NAME)$(exeext) $(ELNA_TARGET_INSTALL_NAME)$(exeext) ); \
|
|
|
|
# Required goals, they still do nothing
|
|
elna.install-man:
|
|
elna.install-info:
|
|
elna.install-pdf:
|
|
elna.install-plugin:
|
|
elna.install-html:
|
|
elna.info:
|
|
elna.dvi:
|
|
elna.pdf:
|
|
elna.html:
|
|
elna.man:
|
|
elna.mostlyclean:
|
|
elna.clean:
|
|
elna.distclean:
|
|
elna.maintainer-clean:
|
|
|
|
# make uninstall
|
|
elna.uninstall:
|
|
-rm -f gelna$(exeext) elna1$(exeext)
|
|
-rm -f $(elna_OBJS)
|
|
|
|
# Used for handling bootstrap
|
|
elna.stage1: stage1-start
|
|
-mv elna/*$(objext) stage1/elna
|
|
elna.stage2: stage2-start
|
|
-mv elna/*$(objext) stage2/elna
|
|
elna.stage3: stage3-start
|
|
-mv elna/*$(objext) stage3/elna
|
|
elna.stage4: stage4-start
|
|
-mv elna/*$(objext) stage4/elna
|
|
elna.stageprofile: stageprofile-start
|
|
-mv elna/*$(objext) stageprofile/elna
|
|
elna.stagefeedback: stagefeedback-start
|
|
-mv elna/*$(objext) stagefeedback/elna
|
|
|
|
ELNA_INCLUDES = -I $(srcdir)/elna/include -I elna/generated
|
|
ELNA_CXXFLAGS = -std=c++11
|
|
|
|
elna/%.o: elna/boot/%.cc elna/generated/parser.hh elna/generated/location.hh
|
|
$(COMPILE) $(ELNA_CXXFLAGS) $(ELNA_INCLUDES) $<
|
|
$(POSTCOMPILE)
|
|
|
|
elna/%.o: elna/generated/%.cc elna/generated/parser.hh elna/generated/location.hh
|
|
$(COMPILE) $(ELNA_CXXFLAGS) $(ELNA_INCLUDES) $<
|
|
$(POSTCOMPILE)
|
|
|
|
elna/%.o: elna/gcc/%.cc elna/generated/parser.hh elna/generated/location.hh
|
|
$(COMPILE) $(ELNA_CXXFLAGS) $(ELNA_INCLUDES) $<
|
|
$(POSTCOMPILE)
|
|
|
|
elna/generated/parser.cc: elna/boot/parser.yy
|
|
mkdir -p $(dir $@)
|
|
$(BISON) -d -o $@ $<
|
|
|
|
elna/generated/parser.hh elna/generated/location.hh: elna/generated/parser.cc
|
|
@touch $@
|
|
|
|
elna/generated/lexer.cc: elna/boot/lexer.ll
|
|
mkdir -p $(dir $@)
|
|
$(FLEX) -o $@ $<
|