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# Original author: Tom Tromey
13# Severely truncated by Hans-J. Boehm
14# Modified by: Grzegorz Jakacki <jakacki at acm dot org>
15# Modified by: Petter Urkedal <petter.urkedal@nordita.dk> (2005-04)
16# Modified by: YAMAMOTO Kengo <yamaken AT bp.iij4u.or.jp> (2006-12, libgcroots)
17
18## Process this file with automake to produce Makefile.in.
19
20include libtool-version.mk
21
22ACLOCAL_AMFLAGS = -I m4
23
24# $(distdir) does work as a part of $(RELEASE_URL) when configured as a
25# subpackage.
26DIST_NAME = $(PACKAGE)-$(VERSION)
27#RELEASE_TAG     = master
28RELEASE_TAG     = $(DIST_NAME)
29DIST_SUM_LIST = $(DIST_NAME).sum
30
31## FIXME: `make distcheck' in this directory will not currently work.
32##     This is most likely to the explicit flags passed to submakes.
33
34# We currently use the source files directly from libatomic_ops, if we
35# use the internal version.  This is done since libatomic_ops doesn't
36# use libtool, since it has no real use for it.  But that seems to make
37# it hard to use either the resulting object files or libraries.
38# Thus there seems too be no real reason to recusively build in the
39# libatomic_ops directory.
40# if USE_INTERNAL_LIBATOMICS_OPS
41# SUBDIRS = @maybe_libatomic_ops@
42# else
43# SUBDIRS =
44# endif
45SUBDIRS =
46
47SUBDIRS += m4
48
49# Initialize variables so that we can declare files locally.
50EXTRA_DIST =
51DISTCLEANFILES =
52lib_LTLIBRARIES =
53include_HEADERS =
54pkginclude_HEADERS =
55dist_noinst_HEADERS =
56check_PROGRAMS =
57TESTS =
58
59pkgconfigdir = $(prefix)/libdata/pkgconfig
60#dist_pkgconfig_DATA = bdw-gc.pc
61EXTRA_DIST += gcroots.pc.in
62pkgconfig_DATA = gcroots.pc
63DISTCLEANFILES += gcroots.pc
64
65# C Library
66# ---------
67
68AM_CPPFLAGS = $(GCROOTS_CPPFLAGS)
69
70#lib_LTLIBRARIES += libgc.la
71#libgc_la_SOURCES = \
72#	allchblk.c alloc.c blacklst.c checksums.c dbg_mlc.c \
73#	dyn_load.c finalize.c gc_dlopen.c gcj_mlc.c headers.c \
74#	malloc.c mallocx.c mark.c mark_rts.c misc.c new_hblk.c \
75#	obj_map.c os_dep.c pcr_interface.c ptr_chck.c real_malloc.c reclaim.c \
76#	specific.c stubborn.c typd_mlc.c \
77#	backgraph.c thread_local_alloc.c
78include_HEADERS += include/gcroots.h
79dist_noinst_HEADERS += \
80	include/private/gcroots_priv.h \
81	include/gc.h \
82	include/gc_mark.h \
83	include/gc_tiny_fl.h \
84	include/gc_config_macros.h \
85	include/private/gc_hdrs.h \
86	include/private/gc_locks.h \
87	include/private/gc_priv.h \
88	include/private/gcconfig.h
89lib_LTLIBRARIES += libgcroots.la
90libgcroots_la_SOURCES = mark.c gcroots.c
91
92# C Library: Architecture Dependent
93# ---------------------------------
94
95#if PTHREADS
96#libgc_la_SOURCES += pthread_support.c pthread_stop_world.c
97#endif
98#
99#if DARWIN_THREADS
100#libgc_la_SOURCES += darwin_stop_world.c
101#endif
102#
103#if WIN32_THREADS
104#libgc_la_SOURCES += win32_threads.c
105#endif
106#
107#if USE_INTERNAL_LIBATOMIC_OPS
108#libgc_la_SOURCES += atomic_ops.c
109#endif
110#
111#if NEED_ATOMIC_OPS_ASM
112#libgc_la_SOURCES += atomic_ops_sysdeps.S
113#endif
114
115# Include THREADDLLIBS here to ensure that the correct versions of
116# linuxthread semaphore functions get linked:
117#libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS)
118#libgc_la_DEPENDENCIES = @addobjs@
119#libgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info 1:3:0 -no-undefined
120
121# Regenerate mach_dep.lo when config.status is updated
122@addobjs@: $(top_builddir)/config.status
123
124#EXTRA_libgc_la_SOURCES = alpha_mach_dep.S \
125#    mips_sgi_mach_dep.s mips_ultrix_mach_dep.s \
126#    rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
127#    sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
128
129libgcroots_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS)
130libgcroots_la_DEPENDENCIES = @addobjs@
131libgcroots_la_LDFLAGS = -version-info $(libgcroots_version)
132
133EXTRA_libgcroots_la_SOURCES = alpha_mach_dep.S \
134    mips_sgi_mach_dep.s mips_ultrix_mach_dep.s \
135    rs6000_mach_dep.s sparc_mach_dep.S sparc_netbsd_mach_dep.s \
136    sparc_sunos4_mach_dep.s ia64_save_regs_in_stack.s
137
138
139# C++ Interface
140# -------------
141
142#if CPLUSPLUS
143#lib_LTLIBRARIES += libgccpp.la
144#pkginclude_HEADERS += include/gc_cpp.h include/gc_allocator.h
145#libgccpp_la_SOURCES = gc_cpp.cc
146#libgccpp_la_LIBADD = $(top_builddir)/libgc.la
147#libgccpp_la_LDFLAGS = -version-info 1:3:0 -no-undefined
148#endif
149
150# FIXME: If Visual C++ users use Makefile.am, this should go into
151# pkginclude_HEADERS with proper AM_CONDITIONALization.  Otherwise
152# delete this comment.
153#EXTRA_DIST += gc_cpp.cpp
154
155
156# Misc
157# ----
158
159AM_CXXFLAGS = @GC_CFLAGS@
160AM_CFLAGS = @GC_CFLAGS@
161
162## FIXME: relies on internal code generated by automake.
163## FIXME: ./configure --enable-dependency-tracking should be used
164#all_objs = @addobjs@ $(libgc_la_OBJECTS)
165#$(all_objs) : include/private/gcconfig.h include/private/gc_priv.h \
166#include/private/gc_hdrs.h include/gc.h include/gc_gcj.h \
167#include/gc_pthread_redirects.h include/gc_config_macros.h \
168#include/private/thread_local_alloc.h include/private_support.h \
169#include/private/pthread_stop_world.h \
170#include/gc_mark.h @addincludes@
171
172## FIXME: we shouldn't have to do this, but automake forces us to.
173## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
174## these.
175if COMPILER_XLC
176  ## XLC neither requires nor tolerates the unnecessary assembler goop
177  ASM_CPP_OPTIONS =
178else
179  ## We use -Wp,-P to strip #line directives.  Irix `as' chokes on
180  ## these.
181  ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp
182endif
183.s.lo:
184	$(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
185
186.S.lo:
187	$(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
188
189## We need to add DEFS to assembler flags
190## :FIXME: what if assembler does not accept -D... ?
191##     (use Autoconf to prepare ASDEFS ???)
192
193CCASFLAGS += $(DEFS)
194
195#dist_noinst_SCRIPTS = callprocs configure.host
196dist_noinst_SCRIPTS = configure.host
197    ## callprocs --- used by Makefile.{dj,direct}
198    ## configure.host --- used by Makefile.{am,dj,direct}
199
200# headers which are not installed
201# (see include/include.am for more)
202#
203#dist_noinst_HEADERS += version.h
204
205# documentation which is not installed
206#
207#EXTRA_DIST += README.QUICK
208
209# other makefiles
210# :GOTCHA: deliberately we do not include 'Makefile'
211#EXTRA_DIST += BCC_MAKEFILE NT_MAKEFILE NT_THREADS_MAKEFILE \
212#    OS2_MAKEFILE PCR-Makefile digimars.mak EMX_MAKEFILE	\
213#    Makefile.direct Makefile.dj	Makefile.DLLs SMakefile.amiga \
214#    WCC_MAKEFILE configure_atomic_ops.sh \
215#    NT_STATIC_THREADS_MAKEFILE NT_X64_STATIC_THREADS_MAKEFILE
216
217# files used by makefiles other than Makefile.am
218#
219#EXTRA_DIST += add_gc_prefix.c gcname.c if_mach.c if_not_there.c \
220#    hpux_test_and_clear.s gc.mak MacOS.c \
221#    MacProjects.sit.hqx mach_dep.c setjmp_t.c \
222#    threadlibs.c AmigaOS.c \
223#    Mac_files/datastart.c Mac_files/dataend.c \
224#    Mac_files/MacOS_config.h Mac_files/MacOS_Test_config.h \
225#    include/private/msvc_dbg.h msvc_dbg.c
226EXTRA_DIST += mach_dep.c
227DISTCLEANFILES += ./$(DEPDIR)/mach_dep.Plo
228
229# The libatomic_ops library.  This is not ideal, since we pick up junk from
230# there.  The hard-coded version number should also go.
231#EXTRA_DIST += libatomic_ops-1.2
232
233# this is an auxiliary shell file used by Makefile and Makefile.direct
234#
235CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host
236
237# :FIXME: why do we distribute this one???
238#
239#EXTRA_DIST += libtool.m4
240
241#
242# :GOTCHA: GNU make rule for making .s out of .S is flawed,
243# it will not remove dest if building fails
244.S.s:
245	if $(CPP) $< >$@ ; then :; else rm -f $@; fi
246
247.PHONY: FORCE sum
248FORCE:
249
250sum: FORCE
251	$(MD5) $(DIST_ARCHIVES) >$(DIST_SUM_LIST)
252	$(SHA1) $(DIST_ARCHIVES) >>$(DIST_SUM_LIST)
253
254#include include/include.am
255#include cord/cord.am
256#include tests/tests.am
257#include doc/doc.am
258# Putting these at the top causes cord to be built first, and not find libgc.a
259# on HP/UX.  There may be a better fix.
260
261tag:
262	cd "$(srcdir)" && git tag -a -m "$(VERSION) has been released!!!" $(VERSION)
263	cd "$(srcdir)" && git push --tags
264