# This is the original manually generated Makefile. It may still be used
# to build the collector.
#
# Primary targets:
# all - builds gc.a, gccpp.a, gctba.a and cord.a
# base_lib - builds gc.a only (basic library)
# c++ - builds gccpp.a and gctba.a only (C++ interface to library)
# cords - builds cord.a only (heavyweight strings library)
# check - same as "all" but also prints porting information, and runs some
# tests of collector and cords
# check-cpp - builds gc.a, gccpp.a and gctba.a, runs C++ only test
# cord/de - builds dumb editor based on cords.
ABI_FLAG=
# ABI_FLAG should be the cc flag that specifies the ABI. On most
# platforms this will be the empty string. Possible values:
# +DD64 for 64-bit executable on HP/UX.
# -n32, -n64, -o32 for SGI/MIPS ABIs.
AS_ABI_FLAG=$(ABI_FLAG)
# ABI flag for assembler. On HP/UX this is +A64 for 64 bit
# executables.
CC=cc $(ABI_FLAG)
# Compiler executable name. For EMX, replace to "gcc".
CXX= c++ $(ABI_FLAG)
# Needed only for "make c++", which builds the C++ interface.
AS=as $(AS_ABI_FLAG)
# The above doesn't work with gas, which doesn't run cpp.
# Define AS as `gcc -c -x assembler-with-cpp' instead.
# Under Irix 6, you have to specify the ABI (-o32, -n32, or -64)
# if you use something other than the default ABI on your machine.
LD=ld
# Redefining srcdir allows object code for the nonPCR version of the collector
# to be generated in different directories.
srcdir= .
VPATH= $(srcdir)
# Path to atomic_ops source.
AO_SRC_DIR=$(srcdir)/libatomic_ops
CFLAGS_EXTRA=
# We need CFLAGS_FOR_PIC because we might be building a shared library.
CFLAGS= -O -I$(srcdir)/include -I$(AO_SRC_DIR)/src \
-DALL_INTERIOR_POINTERS -DENABLE_DISCLAIM -DGC_ATOMIC_UNCOLLECTABLE \
-DGC_GCJ_SUPPORT -DJAVA_FINALIZATION -DNO_EXECUTE_PERMISSION \
-DUSE_MMAP -DUSE_MUNMAP $(CFLAGS_FOR_PIC) $(CFLAGS_EXTRA)
# To build the collector with threads support, add to the above:
# -DGC_THREADS -DPARALLEL_MARK -DTHREAD_LOCAL_ALLOC
#
# To build the preload library that intercepts malloc, add:
# -DGC_USE_DLOPEN_WRAP -DREDIRECT_MALLOC=GC_malloc -fpic
# To build the collector with fork() support by default, add to the above:
# -DHANDLE_FORK
# HOSTCC and HOSTCFLAGS are used to build executables that will be run as
# part of the build process, i.e. on the build machine. These will usually
# be the same as CC and CFLAGS, except in a cross-compilation environment.
# Note that HOSTCFLAGS should include any -D flags that affect thread support.
HOSTCC=$(CC)
HOSTCFLAGS=$(CFLAGS)
# For dynamic library builds, it may be necessary to add flags to generate
# PIC code, e.g. -fPIC on Linux.
# Setjmp_test may yield overly optimistic results when compiled
# without optimization.
# Look into doc/README.macros for the description of the "define arguments"
# influencing the collector configuration.
CXXFLAGS= $(CFLAGS)
AR= ar
RANLIB= ranlib
# For EMX, replace "ranlib" with "ar s".
# Libraries needed for curses applications. Only needed for de.
# It might also require -ltermlib on some targets.
CURSES= -lcurses
# The following is irrelevant on most systems. But a few
# versions of make otherwise fork the shell specified in
# the SHELL environment variable.
SHELL= /bin/sh
SPECIALCFLAGS= -I$(srcdir)/include -I$(AO_SRC_DIR)/src $(CFLAGS_FOR_PIC)
# Alternative flags to the C compiler for mach_dep.c.
# Mach_dep.c often doesn't like optimization, and it's
# not time-critical anyway.
# Set SPECIALCFLAGS to -q nodirect_code on Encore.
all: base_lib cords c++
atomic_ops.o: $(AO_SRC_DIR)/src/atomic_ops.c
$(CC) $(CFLAGS) -c -o $@ $(AO_SRC_DIR)/src/atomic_ops.c
# For some reason, Solaris make does not handle "$<" properly.
# SunOS5 shared library version of the collector
sunos5gc.so: $(OBJS) dyn_load_sunos53.o
$(CC) -G -o sunos5gc.so $(OBJS) dyn_load_sunos53.o -ldl
ln sunos5gc.so libgc.so
# Alpha/OSF shared library version of the collector
libalphagc.so: $(OBJS) dyn_load.o
$(LD) -shared -o libalphagc.so $(OBJS) dyn_load.o -lc
ln libalphagc.so libgc.so
# IRIX shared library version of the collector
libirixgc.so: $(OBJS) dyn_load.o
$(LD) -shared $(ABI_FLAG) -o libirixgc.so $(OBJS) dyn_load.o -lc
ln libirixgc.so libgc.so
# Linux shared library version of the collector
liblinuxgc.so: $(OBJS) dyn_load.o
gcc -shared -o liblinuxgc.so $(OBJS) dyn_load.o
ln liblinuxgc.so libgc.so
# If an optimized setjmp_test generates a segmentation fault,
# odds are your compiler is broken. Gctest may still work.
# Try compiling setjmp_t.c unoptimized.
setjmp_test$(EXEEXT): $(srcdir)/tools/setjmp_t.c $(srcdir)/include/gc.h \
$(UTILS)
$(CC) $(CFLAGS) -o setjmp_test$(EXEEXT) $(srcdir)/tools/setjmp_t.c
# A synonym to "check" (for compatibility with older GC versions).
test: check
# BTL: added to test shared library version of collector.
# Currently works only under SunOS5. Requires GC_INIT call from statically
# loaded client code.
ABSDIR= `pwd`
gctest_dyn_link: tests/test.o libgc.so
$(CC) -L$(ABSDIR) -R$(ABSDIR) -o gctest_dyn_link tests/test.o -lgc -ldl -lthread