# Makefile for GNU vhdl Compiler (GHDL). # Copyright (C) 2002 Free Software Foundation, Inc. #This file is part of GNU CC. #GNU CC 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 2, or (at your option) #any later version. #GNU CC 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 GNU CC; see the file COPYING. If not, write to #the Free Software Foundation, 59 Temple Place - Suite 330, #Boston, MA 02111-1307, USA. # The makefile built from this file lives in the language subdirectory. # It's purpose is to provide support for: # # 1) recursion where necessary, and only then (building .o's), and # 2) building and debugging cc1 from the language subdirectory, and # 3) nothing else. # # The parent makefile handles all other chores, with help from the # language makefile fragment, of course. # # The targets for external use are: # all, TAGS, ???mostlyclean, ???clean. # This makefile will only work with Gnu make. # The rules are written assuming a minimum subset of tools are available: # # Required: # MAKE: Only Gnu make will work. # MV: Must accept (at least) one, maybe wildcard, source argument, # a file or directory destination, and support creation/ # modification date preservation. Gnu mv -f works. # RM: Must accept an arbitrary number of space separated file # arguments, or one wildcard argument. Gnu rm works. # RMDIR: Must delete a directory and all its contents. Gnu rm -rf works. # ECHO: Must support command line redirection. Any Unix-like # shell will typically provide this, otherwise a custom version # is trivial to write. # LN: ln -s works, cp should work bu was not tested. # CP: GNU cp -p works. # AR: Gnu ar works. # MKDIR: Gnu mkdir works. # CHMOD: Gnu chmod works. # true: Does nothing and returns a normal successful return code. # pwd: Prints the current directory on stdout. # cd: Change directory. # Tell GNU make 3.79 not to run this directory in parallel. # Not all of the required dependencies are present. .NOTPARALLEL: # Variables that exist for you to override. # See below for how to change them for certain systems. ALLOCA = # Various ways of specifying flags for compilations: # CFLAGS is for the user to override to, e.g., do a bootstrap with -O2. # BOOT_CFLAGS is the value of CFLAGS to pass # to the stage2 and stage3 compilations # XCFLAGS is used for most compilations but not when using the GCC just built. XCFLAGS = CFLAGS = -g BOOT_CFLAGS = -O $(CFLAGS) # These exists to be overridden by the x-* and t-* files, respectively. X_CFLAGS = T_CFLAGS = X_CPPFLAGS = T_CPPFLAGS = X_ADAFLAGS = T_ADAFLAGS = ADAC = $(CC) ECHO = echo CHMOD = chmod CP = cp -p MV = mv -f RM = rm -f RMDIR = rm -rf MKDIR = mkdir -p LN = ln -s AR = ar # How to invoke ranlib. RANLIB = ranlib # Test to use to see whether ranlib exists on the system. RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ] SHELL = /bin/sh INSTALL_DATA = install -m 644 MAKEINFO = makeinfo TEXI2DVI = texi2dvi GNATBIND = gnatbind GNATMAKE = gnatmake ADA_CFLAGS = $(CFLAGS) GHDL_ADAFLAGS = -Wall -gnata objext = .o exeext = arext = .a soext = .so shext = HOST_CC=$(CC) HOST_CFLAGS=$(ALL_CFLAGS) HOST_CLIB=$(CLIB) HOST_LDFLAGS=$(LDFLAGS) HOST_CPPFLAGS=$(ALL_CPPFLAGS) HOST_ALLOCA=$(ALLOCA) HOST_MALLOC=$(MALLOC) HOST_OBSTACK=$(OBSTACK) # We don't use cross-make. Instead we use the tools from the build tree, # if they are available. # program_transform_name and objdir are set by configure.in. program_transform_name = objdir = . target=@target@ target_alias=@target_alias@ target_noncanonical:=@target_noncanonical@ xmake_file=@dep_host_xmake_file@ tmake_file=@dep_tmake_file@ #version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c` #mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c` # Directory where sources are, from where we are. srcdir = @srcdir@ VPATH = @srcdir@ # Top build directory, relative to here. top_builddir = .. version := $(shell cat $(srcdir)/../BASE-VER) # End of variables for you to override. # Definition of `all' is here so that new rules inserted by sed # do not specify the default target. all: # This tells GNU Make version 3 not to put all variables in the environment. .NOEXPORT: force: SED=sed clean: grt-clean ghdllibs-clean force $(RM) *.o *.ali # Additionnal rules LIBSRC_DIR:=$(srcdir)/libraries LIBDST_DIR:=lib ANALYZE=../../../../ghdl -a --GHDL1=./ghdl1 --ieee=none $(LIB_CFLAGS) ANALYZE_DEP:= ####libraries Makefile.inc std87_standard.o: $(GHDL1) $(GHDL1) --std=87 -quiet -o std87_standard.s --compile-standard ../xgcc -c -o $@ std87_standard.s $(RM) -f std87_standard.s std93_standard.o: $(GHDL1) $(GHDL1) --std=93 -quiet -o std93_standard.s --compile-standard ../xgcc -c -o $@ std93_standard.s $(RM) -f std93_standard.s std08_standard.o: $(GHDL1) $(GHDL1) --std=08 -quiet -o std08_standard.s --compile-standard ../xgcc -c -o $@ std08_standard.s $(RM) -f std08_standard.s ghdllib: libgrt.a std87_standard.o std93_standard.o std08_standard.o vhdl.libs.all ghdllibs-clean: force $(RM) -rf $(LIB87_DIR) $(LIB93_DIR) $(LIB08_DIR) PHONY: ghdllib ghdllibs-clean GHDL1=../ghdl1 GRTSRCDIR=$(srcdir)/grt GRT_RANLIB=$(RANLIB) ####grt Makefile.inc install-ghdllib: ghdllib grt.lst $(RM) -rf $(DESTDIR)$(VHDL_LIB_DIR) $(MKDIR) $(DESTDIR)$(VHDL_LIB_DIR) # Install libgrt $(INSTALL_DATA) libgrt.a $(DESTDIR)$(VHDL_LIB_DIR)/libgrt.a $(INSTALL_DATA) grt.lst $(DESTDIR)$(VHDL_LIB_DIR)/grt.lst $(INSTALL_DATA) $(GRTSRCDIR)/grt.ver $(DESTDIR)$(VHDL_LIB_DIR)/grt.ver # Install VHDL sources. for d in $(VHDLLIB_SUBDIRS); do \ $(MKDIR) -p $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \ $(INSTALL_DATA) -p \ $(LIBDST_DIR)/$$d/* $(DESTDIR)$(VHDL_LIB_DIR)/$$d; \ done # Copy std_standard (this is done after libraries, since they remove dirs). $(INSTALL_DATA) std87_standard.o \ $(DESTDIR)$(VHDL_LIB_DIR)/v87/std/std_standard.o $(INSTALL_DATA) std93_standard.o \ $(DESTDIR)$(VHDL_LIB_DIR)/v93/std/std_standard.o $(INSTALL_DATA) std08_standard.o \ $(DESTDIR)$(VHDL_LIB_DIR)/v08/std/std_standard.o