Makefile.am raw
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` file.
13
14 # Info (`current:revision:age`) for the Libtool versioning system.
15 # These numbers should be updated at most once just before the release,
16 # and, optionally, at most once during the development (after the release).
17 LIBGC_VER_INFO = 6:3:5
18 LIBGCCPP_VER_INFO = 6:0:5
19
20 # We currently use the source files directly from `libatomic_ops` directory,
21 # if we use the internal variant. (Thus there seems to be no real reason to
22 # recursively build in the `libatomic_ops` directory.)
23 SUBDIRS =
24
25 ACLOCAL_AMFLAGS = -I m4
26 AM_CPPFLAGS = \
27 -I$(top_builddir)/include -I$(top_srcdir)/include \
28 $(ATOMIC_OPS_CFLAGS)
29
30 ## Initialize variables so that we can declare files locally.
31 EXTRA_DIST =
32 lib_LTLIBRARIES =
33 include_HEADERS =
34 pkginclude_HEADERS =
35 dist_noinst_HEADERS =
36 check_PROGRAMS =
37 check_LTLIBRARIES =
38 TESTS =
39
40 pkgconfigdir = $(libdir)/pkgconfig
41 pkgconfig_DATA = bdw-gc.pc
42
43 # C Library
44 # ---------
45
46 lib_LTLIBRARIES += libgc.la
47
48 if SINGLE_GC_OBJ
49
50 libgc_la_SOURCES = extra/gc.c
51
52 if PTHREAD_START_STANDALONE
53 AM_CPPFLAGS += -DGC_PTHREAD_START_STANDALONE
54 libgc_la_SOURCES += pthread_start.c
55 endif
56
57 else
58
59 EXTRA_DIST += extra/gc.c
60 libgc_la_SOURCES = \
61 allchblk.c alloc.c blacklst.c dbg_mlc.c dyn_load.c finalize.c \
62 headers.c mach_dep.c malloc.c mallocx.c mark.c mark_rts.c misc.c \
63 new_hblk.c os_dep.c ptr_chck.c reclaim.c typd_mlc.c
64
65 if MAKE_BACK_GRAPH
66 libgc_la_SOURCES += backgraph.c
67 endif
68
69 if CHECKSUMS
70 libgc_la_SOURCES += checksums.c
71 endif
72
73 if ENABLE_DISCLAIM
74 libgc_la_SOURCES += fnlz_mlc.c
75 endif
76
77 if ENABLE_GCJ_SUPPORT
78 libgc_la_SOURCES += gcj_mlc.c
79 endif
80
81 # C library: architecture dependent
82 # ---------------------------------
83
84 if THREADS
85
86 libgc_la_SOURCES += gc_dlopen.c pthread_start.c pthread_support.c
87
88 if THREAD_LOCAL_ALLOC
89 libgc_la_SOURCES += specific.c thread_local_alloc.c
90 endif
91
92 if WIN32_THREADS
93 libgc_la_SOURCES += win32_threads.c
94 else
95 if DARWIN_THREADS
96 libgc_la_SOURCES += darwin_stop_world.c
97 else
98 libgc_la_SOURCES += pthread_stop_world.c
99 endif
100 endif
101
102 endif
103
104 ## End of !SINGLE_GC_OBJ
105 endif
106
107 if USE_INTERNAL_LIBATOMIC_OPS
108 nodist_libgc_la_SOURCES = libatomic_ops/src/atomic_ops.c
109 if NEED_ATOMIC_OPS_ASM
110 nodist_libgc_la_SOURCES += libatomic_ops/src/atomic_ops_sysdeps.S
111 endif
112 endif
113
114 # Include `THREADDLLIBS` here to ensure that the correct versions of
115 # LinuxThreads semaphore (and `clock_gettime`) functions get linked:
116 libgc_la_LIBADD = @addobjs@ $(THREADDLLIBS) $(UNWINDLIBS) $(ATOMIC_OPS_LIBS)
117 libgc_la_DEPENDENCIES = @addobjs@
118 libgc_la_LDFLAGS = $(extra_ldflags_libgc) -version-info $(LIBGC_VER_INFO) \
119 -no-undefined
120
121 EXTRA_libgc_la_SOURCES = ia64_save_regs_in_stack.s sparc_mach_dep.S \
122 sparc_netbsd_mach_dep.s
123
124 if CPLUSPLUS
125 # C++ Interface
126 # -------------
127 lib_LTLIBRARIES += libgccpp.la
128 libgccpp_la_SOURCES = gc_badalc.cc gc_cpp.cc
129 libgccpp_la_LIBADD = libgc.la
130 libgccpp_la_LDFLAGS = -version-info $(LIBGCCPP_VER_INFO) -no-undefined
131 if GC_TBA_LIBRARY
132 # The same as `libgccpp` but contains only `gc_badalc.o` file.
133 lib_LTLIBRARIES += libgctba.la
134 libgctba_la_SOURCES = gc_badalc.cc
135 libgctba_la_LIBADD = libgc.la
136 # Set the same version as for `libgccpp`.
137 libgctba_la_LDFLAGS = -version-info $(LIBGCCPP_VER_INFO) -no-undefined
138 endif
139 endif
140
141 EXTRA_DIST += gc_badalc.cpp gc_cpp.cpp
142
143
144 # Misc
145 # ----
146
147 AM_CXXFLAGS = $(WERROR_CFLAGS) @GC_CFLAGS@
148 AM_CFLAGS = $(WERROR_CFLAGS) @GC_CFLAGS@
149
150 CFLAGS += $(CFLAGS_EXTRA)
151 CXXFLAGS += $(CFLAGS_EXTRA)
152
153 ## FIXME: relies on internal code generated by `automake`.
154 ## FIXME: `./configure --enable-dependency-tracking` should be used.
155
156 ## FIXME: we should not have to do this, but `automake` forces us to.
157 ## We use `-Wp,-P` to strip `#line` directives. Irix `as` chokes on these.
158 if ASM_WITH_CPP_UNSUPPORTED
159 ASM_CPP_OPTIONS =
160 else
161 ASM_CPP_OPTIONS = -Wp,-P -x assembler-with-cpp
162 endif
163
164 .s.lo:
165 $(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
166
167 .S.lo:
168 $(LTCOMPILE) $(ASM_CPP_OPTIONS) -c $<
169
170 ## We need to add `DEFS` to assembler flags.
171 ## :FIXME: what if assembler does not accept `-D...` ?
172 ## (use `autoconf` to prepare `ASDEFS`?)
173
174 CCASFLAGS += $(DEFS)
175
176 # The headers which are not installed (see `include/include.am` file for more).
177
178 # Other makefiles.
179 EXTRA_DIST += Makefile.direct NT_MAKEFILE WCC_MAKEFILE digimars.mak \
180 autogen.sh build.zig build.zig.zon CMakeLists.txt Config.cmake.in
181
182 # The files used by makefiles other than `Makefile.am` file.
183 EXTRA_DIST += tools/if_mach.c tools/if_not_there.c tools/setjmp_t.c \
184 tools/threadlibs.c tools/callprocs.sh extra/msvc_dbg.c \
185 extra/symbian/global_end.cpp extra/symbian/global_start.cpp \
186 extra/symbian/init_global_static_roots.cpp extra/symbian.cpp
187
188 # :GOTCHA: GNU `make` rule for making `.s` out of `.S` is flawed, it will
189 # not remove dest if building fails.
190 .S.s:
191 if $(CPP) $< >$@ ; then :; else rm -f $@; fi
192
193 include include/include.am
194 include cord/cord.am
195 include tests/tests.am
196
197 ## Putting these at the top causes cord to be built first, and not find
198 ## `libgc.a` file on HP/UX. There may be a better fix.
199
200 # Installed documentation.
201 if ENABLE_DOCS
202 dist_doc_DATA = \
203 AUTHORS \
204 ChangeLog \
205 LICENSE \
206 README.md
207
208 docdocsdir = $(docdir)/docs
209 dist_docdocs_DATA = \
210 docs/autoconf.md \
211 docs/cmake.md \
212 docs/cords.md \
213 docs/debugging.md \
214 docs/environment.md \
215 docs/faq.md \
216 docs/finalization.md \
217 docs/gcdescr.md \
218 docs/gcinterface.md \
219 docs/leak.md \
220 docs/macros.md \
221 docs/overview.md \
222 docs/porting.md \
223 docs/scale.md \
224 docs/simple_example.md \
225 docs/tree.md
226
227 docdocsplatformsdir = $(docdocsdir)/platforms
228 dist_docdocsplatforms_DATA = \
229 docs/platforms/README.aix \
230 docs/platforms/README.arm_cross \
231 docs/platforms/README.darwin \
232 docs/platforms/README.dgux386 \
233 docs/platforms/README.emscripten \
234 docs/platforms/README.ews4800 \
235 docs/platforms/README.hp \
236 docs/platforms/README.linux \
237 docs/platforms/README.os2 \
238 docs/platforms/README.sgi \
239 docs/platforms/README.solaris2 \
240 docs/platforms/README.symbian \
241 docs/platforms/README.uts \
242 docs/platforms/README.win32 \
243 docs/platforms/README.win64
244
245 dist_man3_MANS = gc.man
246 endif
247
248 # A dummy target for `mono` build.
249 test-bundle:
250