1# Copyright (c) 1999-2001 by Red Hat, Inc. All rights reserved.
2#
3# THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
4# OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
5#
6# Permission is hereby granted to use or copy this program
7# for any purpose,  provided the above notices are retained on all copies.
8# Permission to modify the code and to distribute modified code is granted,
9# provided the above notices are retained, and a notice that the code was
10# modified is included with the above copyright notice.
11
12## Process this file with automake to produce Makefile.in.
13
14## FIXME: `make distcheck' in this directory will not currently work.
15##     This is most likely to the explicit flags passed to submakes.
16
17# We currently use the source files directly from libatomic_ops, if we
18# use the internal version.  This is done since libatomic_ops doesn't
19# use libtool, since it has no real use for it.  But that seems to make
20# it hard to use either the resulting object files or libraries.
21# Thus there seems too be no real reason to recursively build in the
22# libatomic_ops directory.
23# if USE_INTERNAL_LIBATOMICS_OPS
24# SUBDIRS = @maybe_libatomic_ops@
25# else
26# SUBDIRS =
27# endif
28SUBDIRS =
29
30ACLOCAL_AMFLAGS = -I m4
31AM_CPPFLAGS = \
32    -I$(top_builddir)/include -I$(top_srcdir)/include \
33    $(ATOMIC_OPS_CFLAGS)
34
35# Initialize variables so that we can declare files locally.
36EXTRA_DIST =
37lib_LTLIBRARIES =
38include_HEADERS =
39pkginclude_HEADERS =
40dist_noinst_HEADERS =
41check_PROGRAMS =
42check_LTLIBRARIES =
43TESTS =
44
45pkgconfigdir = $(libdir)/pkgconfig
46pkgconfig_DATA = bdw-gc.pc
47
48# C Library
49# ---------
50
51lib_LTLIBRARIES += libgc.la
52if SINGLE_GC_OBJ
53libgc_la_SOURCES = extra/gc.c
54else
55EXTRA_DIST += extra/gc.c
56libgc_la_SOURCES = \
57    allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
58    dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
59    mach_dep.c malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
60    obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
61    specific.c stubborn.c thread_local_alloc.c typd_mlc.c
62
63# C Library: Architecture Dependent
64# ---------------------------------
65
66if WIN32_THREADS
67libgc_la_SOURCES += win32_threads.c
68else
69if PTHREADS
70libgc_la_SOURCES += pthread_start.c pthread_support.c
71if DARWIN_THREADS
72libgc_la_SOURCES += darwin_stop_world.c
73else
74libgc_la_SOURCES += pthread_stop_world.c
75endif
76endif
77endif
78
79if MAKE_BACK_GRAPH
80libgc_la_SOURCES += backgraph.c
81endif
82
83if ENABLE_DISCLAIM
84libgc_la_SOURCES += fnlz_mlc.c
85endif
86
87endif
88
89if USE_INTERNAL_LIBATOMIC_OPS
90nodist_libgc_la_SOURCES = libatomic_ops/src/atomic_ops.c
91endif
92
93if NEED_ATOMIC_OPS_ASM
94nodist_libgc_la_SOURCES = libatomic_ops/src/atomic_ops_sysdeps.S
95endif
96
97# Include THREADDLLIBS here to ensure that the correct versions of
98# linuxthread semaphore functions get linked:
99libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS) $(ATOMIC_OPS_LIBS)
100libgc_la_DEPENDENCIES = @addobjs@
101libgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:3:0 -no-undefined
102
103EXTRA_libgc_la_SOURCES = ia64_save_regs_in_stack.s sparc_mach_dep.S \
104    sparc_netbsd_mach_dep.s sparc_sunos4_mach_dep.s
105
106
107# C++ Interface
108# -------------
109
110if CPLUSPLUS
111lib_LTLIBRARIES += libgccpp.la
112pkginclude_HEADERS += include/gc_cpp.h
113include_HEADERS += include/extra/gc_cpp.h
114libgccpp_la_SOURCES = gc_cpp.cc
115libgccpp_la_LIBADD = ./libgc.la
116libgccpp_la_LDFLAGS = -version-info 1:3:0 -no-undefined
117endif
118
119# FIXME: If Visual C++ users use Makefile.am, this should go into
120# pkginclude_HEADERS with proper AM_CONDITIONALization.  Otherwise
121# delete this comment.
122EXTRA_DIST += gc_cpp.cpp
123
124
125# Misc
126# ----
127
128AM_CXXFLAGS = @GC_CFLAGS@
129AM_CFLAGS = @GC_CFLAGS@
130
131## FIXME: relies on internal code generated by automake.
132## FIXME: ./configure --enable-dependency-tracking should be used
133#all_objs = @addobjs@ $(libgc_la_OBJECTS)
134#$(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
135#include/private/gc_hdrs.h include/gc.h include/gc_gcj.h \
136#include/gc_pthread_redirects.h include/gc_config_macros.h \
137#include/private/thread_local_alloc.h include/private_support.h \
138#include/private/pthread_stop_world.h \
139#include/gc_mark.h @addincludes@
140
141## FIXME: we shouldn't have to do this, but automake forces us to.
142## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
143## these.
144if ASM_WITH_CPP_UNSUPPORTED
145  ASM_CPP_OPTIONS =
146else
147  ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp
148endif
149
150.s.lo:
151	$(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
152
153.S.lo:
154	$(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
155
156## We need to add DEFS to assembler flags
157## :FIXME: what if assembler does not accept -D... ?
158## (use Autoconf to prepare ASDEFS?)
159
160CCASFLAGS += $(DEFS)
161
162# headers which are not installed
163# (see include/include.am for more)
164#
165
166# documentation which is not installed
167#
168EXTRA_DIST += README.QUICK
169
170# other makefiles
171# :GOTCHA: deliberately we do not include 'Makefile'
172EXTRA_DIST += BCC_MAKEFILE NT_MAKEFILE \
173    OS2_MAKEFILE PCR-Makefile digimars.mak EMX_MAKEFILE \
174    Makefile.direct Makefile.dj SMakefile.amiga \
175    WCC_MAKEFILE autogen.sh build_atomic_ops.sh build_atomic_ops.sh.cygwin \
176    NT_STATIC_THREADS_MAKEFILE NT_X64_STATIC_THREADS_MAKEFILE \
177    NT_X64_THREADS_MAKEFILE CMakeLists.txt tests/CMakeLists.txt
178
179# files used by makefiles other than Makefile.am
180#
181EXTRA_DIST += tools/add_gc_prefix.c tools/gcname.c tools/if_mach.c \
182    tools/if_not_there.c tools/setjmp_t.c tools/threadlibs.c \
183    gc.mak extra/MacOS.c extra/AmigaOS.c \
184    extra/symbian/global_end.cpp extra/symbian/global_start.cpp \
185    extra/symbian/init_global_static_roots.cpp extra/symbian.cpp \
186    build/s60v3/bld.inf build/s60v3/libgc.mmp \
187    extra/Mac_files/datastart.c extra/Mac_files/dataend.c \
188    extra/Mac_files/MacOS_config.h \
189    include/private/msvc_dbg.h extra/msvc_dbg.c tools/callprocs.sh
190
191#
192# :GOTCHA: GNU make rule for making .s out of .S is flawed,
193# it will not remove dest if building fails
194.S.s:
195	if $(CPP) $< >$@ ; then :; else rm -f $@; fi
196
197include include/include.am
198include cord/cord.am
199include tests/tests.am
200include doc/doc.am
201# Putting these at the top causes cord to be built first, and not find libgc.a
202# on HP/UX.  There may be a better fix.
203