blob: ba084dcfbbdb61e9679a75e9b5207dee101b0996 [file] [log] [blame]
# This is the Unix/NT makefile used to build an alternate GNAT run-time.
# Note that no files in the original GNAT library dirctory will be
# modified by this procedure
# This Makefile requires Gnu make.
# Here is how to use this Makefile
# 1. Create a new directory (say adalib)
# e.g. $ mkdir adalib
# $ cd adalib
# 2. Copy this Makefile from the standard Adalib directory, e.g.
# $ cp /usr/local/gnat/lib/gcc-lib/<target>/<version>/adalib/Makefile.adalib .
# 3. If needed (e.g for pragma Normalize_Scalars), create a gnat.adc
# containing the configuration pragmas you want to use to build the library
# e.g. $ echo pragma Normalize_Scalars; > gnat.adc
# Note that this step is usually not needed, and most pragmas are not
# relevant to the GNAT run time.
# 4. Determine the values of the following MACROS
# ROOT (location of GNAT installation, e.g /usr/local/gnat)
# and optionnally
# CFLAGS (back end compilation flags such as -g -O2)
# ADAFLAGS (front end compilation flags such as -gnatpgn)
# *beware* the minimum value for this MACRO is -gnatpg
# for proper compilation of the GNAT library
# 5a. If you are using a native compile, call make
# e.g. $ make -f Makefile.adalib ROOT=/usr/local/gnat CFLAGS="-g -O0"
# 5b. If you are using a cross compiler, you need to define two additional
# CC (name of the cross compiler)
# AR (name of the cross ar)
# e.g. $ make -f Makefile.adalib ROOT=/opt/gnu/gnat \
# CFLAGS="-O2 -g -I/usr/wind/target/h" CC=powerpc-wrs-vxworks-gcc \
# AR=arppc
# 6. put this new library on your Object PATH where you want to use it
# in place of the original one. This can be achieved for instance by
# updating the value of the environment variable ADA_OBJECTS_PATH
CC = gcc
AR = ar
ifeq ($(strip $(filter-out %sh,$(SHELL))),)
GNAT_ROOT = $(shell cd $(ROOT);${PWD_COMMAND})/
target = $(shell $(CC) -dumpmachine)
version = $(shell $(CC) -dumpversion)
ADA_INCLUDE_PATH = $(GNAT_ROOT)lib/gcc-lib/$(target)/$(version)/adainclude/
GCC_INCLUDE_PATH = $(GNAT_ROOT)lib/gcc-lib/$(target)/$(version)/gcc-include/
ADA_OBJECTS_PATH = $(GNAT_ROOT)lib/gcc-lib/$(target)/$(version)/adalib/
vpath %.adb $(ADA_INCLUDE_PATH)
vpath %.c $(ADA_INCLUDE_PATH)
vpath %.h $(ADA_INCLUDE_PATH)
GNATLIBCFLAGS = -DIN_RTS=1 -DIN_GCC=1 -fexceptions
ADAFLAGS = -gnatpgn
-I$(GCC_INCLUDE_PATH)/gcc/config -I$(GCC_INCLUDE_PATH)/gcc \
# Say how to compile Ada programs.
.SUFFIXES: .ada .adb .ads
$(CC) -c $(ALL_ADAFLAGS) $<
$(CC) -c $(ALL_ADAFLAGS) $<
GNAT_OBJS :=$(filter-out __%,$(shell $(AR) t $(ADA_OBJECTS_PATH)libgnat.a))
GNARL_OBJS:=$(filter-out __%,$(shell $(AR) t $(ADA_OBJECTS_PATH)libgnarl.a))
all: libgnat.a libgnarl.a delete_objects g-trasym.o
chmod 0444 *.ali *.a
rm *.o
libgnat.a: $(GNAT_OBJS)
$(AR) r libgnat.a $(GNAT_OBJS)
libgnarl.a: $(GNARL_OBJS)
$(AR) r libgnarl.a $(GNARL_OBJS)
a-except.o: a-except.adb
$(CC) -c $(FORCE_DEBUG_ADAFLAGS) $(ALL_ADAFLAGS) -O0 -fno-inline $<
s-assert.o: s-assert.adb
s-tasdeb.o: s-tasdeb.adb
s-vaflop.o: s-vaflop.adb
s-memory.o: s-memory.adb
s-traceb.o: s-traceb.adb
$(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -fno-optimize-sibling-calls $(ADA_INCLUDES) $<
tracebak.o: tracebak.c
$(ALL_CPPFLAGS) $(INCLUDES) -fno-omit-frame-pointer $<
.PHONY: delete_objects