Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 460 lines (352 sloc) 13.666 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459
# makefile for Gambit-C compiler.

# Copyright (c) 1994-2012 by Marc Feeley, All Rights Reserved.

herefromroot = gsc
rootfromhere = ..
SUBDIRS =

PACKAGE_SHORTNAME = @PACKAGE_SHORTNAME@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_TARNAME = @PACKAGE_TARNAME@

@SET_MAKE@

srcdir = @srcdir@
VPATH = @srcdir@
srcdirpfx = @srcdirpfx@

C_COMPILER = @C_COMPILER_MF@
C_PREPROC = @C_PREPROC_MF@
FLAGS_OBJ = @FLAGS_OBJ_MF@
FLAGS_DYN = @FLAGS_DYN_MF@
FLAGS_LIB = @FLAGS_LIB_MF@
FLAGS_EXE = @FLAGS_EXE_MF@
DEFS = @DEFS@
LIBS = @LIBS@

GAMBCLIB_DEFS = @GAMBCLIB_DEFS_MF@
LIB_PREFIX = @LIB_PREFIX@
LIB_EXTENSION = @LIB_EXTENSION@
GAMBCLIB = @GAMBCLIB@
GAMBCGSCLIB = @GAMBCGSCLIB@
GAMBCGSILIB = @GAMBCGSILIB@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_LIB = @INSTALL_LIB@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
LN_S = @LN_S@
RANLIB = @RANLIB@
RC = @RC@
GIT = @GIT@
HG = @HG@

prefix = @prefix@
exec_prefix = @exec_prefix@
includedir = @includedir@
libdir = @libdir@
bindir = @bindir@
docdir = @docdir@
infodir = @infodir@
emacsdir = @emacsdir@
libexecdir = @libexecdir@
datarootdir = @datarootdir@
datadir = @datadir@
htmldir = @htmldir@
dvidir = @dvidir@
pdfdir = @pdfdir@
psdir = @psdir@
localedir = @localedir@
mandir = @mandir@

.SUFFIXES:
.SUFFIXES: .scm .c @obj@

HEADERS_SCM = "_assert\#.scm" "_asm\#.scm" "_x86\#.scm" "_codegen\#.scm"

LIBRARIES_SCM = $(HEADERS_SCM)

LIBRARY = $(LIB_PREFIX)$(GAMBCGSCLIB)$(LIB_EXTENSION)
LIBRARY_NORMAL_C =
LIBRARY_NORMAL_CPP =
LIBRARY_NORMAL_H =
LIBRARY_NORMAL_O =
LIBRARY_NORMAL_O_PLUS =
LIBRARY_NORMAL_O_COMMA =
LIBRARY_NORMAL_SOURCES = $(LIBRARY_NORMAL_C) $(LIBRARY_NORMAL_CPP) \
$(LIBRARY_NORMAL_H)
LIBRARY_MODULES = _host _utils _source _parms \
_env _ptree1 _ptree2 _gvm _back _front \
_prims _assert _asm _x86 _codegen \
_t-univ _t-c-1 _t-c-2 _t-c-3 \
_gsclib
LIBRARY_MODULES_SCM = _host.scm _utils.scm _source.scm _parms.scm \
_env.scm _ptree1.scm _ptree2.scm _gvm.scm _back.scm _front.scm \
_prims.scm _assert.scm _asm.scm _x86.scm _codegen.scm \
_t-univ.scm _t-c-1.scm _t-c-2.scm _t-c-3.scm \
_gsclib.scm
LIBRARY_MODULES_C = _host.c _utils.c _source.c _parms.c \
_env.c _ptree1.c _ptree2.c _gvm.c _back.c _front.c \
_prims.c _assert.c _asm.c _x86.c _codegen.c \
_t-univ.c _t-c-1.c _t-c-2.c _t-c-3.c \
_gsclib.c
LIBRARY_MODULES_O = _host@obj@ _utils@obj@ _source@obj@ _parms@obj@ \
_env@obj@ _ptree1@obj@ _ptree2@obj@ _gvm@obj@ _back@obj@ _front@obj@ \
_prims@obj@ _assert@obj@ _asm@obj@ _x86@obj@ _codegen@obj@ \
_t-univ@obj@ _t-c-1@obj@ _t-c-2@obj@ _t-c-3@obj@ \
_gsclib@obj@
LIBRARY_MODULES_O_PLUS = +_host@obj@ +_utils@obj@ +_source@obj@ +_parms@obj@ \
+_env@obj@ +_ptree1@obj@ +_ptree2@obj@ +_gvm@obj@ +_back@obj@ +_front@obj@ \
+_prims@obj@ +_assert@obj@ +_asm@obj@ +_x86@obj@ +_codegen@obj@ \
+_t-univ@obj@ +_t-c-1@obj@ +_t-c-2@obj@ +_t-c-3@obj@ \
+_gsclib@obj@
LIBRARY_MODULES_O_COMMA = _host@obj@,_utils@obj@,_source@obj@,_parms@obj@,\
_env@obj@,_ptree1@obj@,_ptree2@obj@,_gvm@obj@,_back@obj@,_front@obj@,\
_prims@obj@,_assert@obj@,_asm@obj@,_x86@obj@,_codegen@obj@,\
_t-univ@obj@,_t-c-1@obj@,_t-c-2@obj@,_t-c-3@obj@,\
_gsclib@obj@
LIBRARY_MODULES_O_IN_COMPILE_ORDER = _t-c-2@obj@ _ptree1@obj@ _ptree2@obj@ \
_front@obj@ _t-univ@obj@ _t-c-1@obj@ _gvm@obj@ _source@obj@ _t-c-3@obj@ \
_x86@obj@ _asm@obj@ _utils@obj@ _parms@obj@ _host@obj@ _env@obj@ _prims@obj@ \
_back@obj@ _codegen@obj@ _assert@obj@ _gsclib@obj@
LIBRARY_OBJECTS = $(LIBRARY_NORMAL_O) \
$(LIBRARY_MODULES_O) _$(GAMBCGSCLIB)@obj@
LIBRARY_OBJECTS_PLUS = $(LIBRARY_NORMAL_O_PLUS) \
$(LIBRARY_MODULES_O_PLUS) +_$(GAMBCGSCLIB)@obj@
LIBRARY_OBJECTS_COMMA = $(LIBRARY_NORMAL_O_COMMA),\
$(LIBRARY_MODULES_O_COMMA),_$(GAMBCGSCLIB)@obj@
LIBRARY_OBJECTS_IN_COMPILE_ORDER = $(LIBRARY_MODULES_O_IN_COMPILE_ORDER) \
$(LIBRARY_NORMAL_O_IN_COMPILE_ORDER) _$(GAMBCGSCLIB)@obj@

LIBRARIES = $(LIBRARY)

MAKE_LIBRARY_LIBS = $(rootfromhere)/lib/$(LIB_PREFIX)$(GAMBCLIB)$(LIB_EXTENSION)
MAKE_LIBRARY_FOR_INSTALL_LIBS = @MAKE_LIBRARY_FOR_INSTALL_LIBS@

EXECUTABLE = gsc@exe@
EXECUTABLE_INSTALLED = @ENABLE_COMPILER_NAME@@exe@
EXECUTABLE_NORMAL_C =
EXECUTABLE_NORMAL_CPP =
EXECUTABLE_NORMAL_H =
EXECUTABLE_NORMAL_O =
EXECUTABLE_NORMAL_O_PLUS =
EXECUTABLE_NORMAL_O_COMMA =
EXECUTABLE_NORMAL_SOURCES = $(EXECUTABLE_NORMAL_C) $(EXECUTABLE_NORMAL_CPP) \
$(EXECUTABLE_NORMAL_H)
EXECUTABLE_MODULES = _gsc
EXECUTABLE_MODULES_SCM = _gsc.scm
EXECUTABLE_MODULES_C = _gsc.c
EXECUTABLE_MODULES_O = _gsc@obj@
EXECUTABLE_MODULES_O_PLUS = +_gsc@obj@
EXECUTABLE_MODULES_O_COMMA = _gsc@obj@
EXECUTABLE_MODULES_O_IN_COMPILE_ORDER = _gsc@obj@
EXECUTABLE_OBJECTS = $(EXECUTABLE_NORMAL_O) \
$(EXECUTABLE_MODULES_O) _gsc_@obj@
EXECUTABLE_OBJECTS_PLUS = $(EXECUTABLE_NORMAL_O_PLUS) \
$(EXECUTABLE_MODULES_O_PLUS) +_gsc_@obj@
EXECUTABLE_OBJECTS_COMMA = $(EXECUTABLE_NORMAL_O_COMMA),\
$(EXECUTABLE_MODULES_O_COMMA),_gsc_@obj@
EXECUTABLE_OBJECTS_IN_COMPILE_ORDER = $(EXECUTABLE_MODULES_O_IN_COMPILE_ORDER) \
$(EXECUTABLE_NORMAL_O_IN_COMPILE_ORDER) _gsc_@obj@

LINK_LIBS = $(LIBRARY) $(rootfromhere)/lib/$(LIB_PREFIX)$(GAMBCLIB)$(LIB_EXTENSION)
LINK_FOR_INSTALL_LIBS = @LINK_FOR_INSTALL_GSC_LIBS@

MODULES_SCM = $(LIBRARY_MODULES_SCM) $(EXECUTABLE_MODULES_SCM)
MODULES_C = $(LIBRARY_MODULES_C) $(EXECUTABLE_MODULES_C)
OBJECTS = $(LIBRARY_OBJECTS) $(EXECUTABLE_OBJECTS)

RCFILES = makefile.in fixnum.scm generic.scm igsc.scm $(MODULES_SCM) \
$(LIBRARIES_SCM) _envadt.scm _gvmadt.scm _ptreeadt.scm _sourceadt.scm \
runtests.scm

GENDISTFILES = $(MODULES_C) _$(GAMBCGSCLIB).c _gsc_.c

DISTFILES = $(RCFILES) $(GENDISTFILES)

INSTFILES_LIB_DATA = _$(GAMBCGSCLIB).c $(LIBRARIES_SCM)

GAMBCDIR_INCLUDE = $(srcdirpfx)$(rootfromhere)/include
GAMBCDIR_LIB = $(srcdirpfx)$(rootfromhere)/lib
GAMBCDIR_LIB_GSI = $(srcdirpfx)$(rootfromhere)/gsi
GAMBCDIR_LIB_GSC = $(srcdirpfx)$(rootfromhere)/gsc

BUILD_OBJ_OUTPUT_FILENAME = $*@obj@
BUILD_OBJ_CC_OPTIONS = -I$(srcdir) $(DEFS)
BUILD_OBJ_INPUT_FILENAMES = $(srcdirpfx)$*.c

BUILD_EXE_OUTPUT_FILENAME = $(EXECUTABLE)
BUILD_EXE_CC_OPTIONS =
BUILD_EXE_LD_OPTIONS_PRELUDE =
BUILD_EXE_INPUT_FILENAMES = $(EXECUTABLE_OBJECTS)
BUILD_EXE_LD_OPTIONS = $(LIBRARY)

all:

all-pre:

all-post: $(LIBRARY) $(EXECUTABLE)

$(LIBRARY): $(LIBRARY_OBJECTS_IN_COMPILE_ORDER)
rm -f $(LIBRARY)
@MAKE_LIBRARY@

_$(GAMBCGSCLIB).c: $(LIBRARY_MODULES_C) $(rootfromhere)/lib/_gambc.c
@SETDLPATHBOOT@ $(rootfromhere)/gsc-boot -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -link -l $(srcdirpfx)$(rootfromhere)/lib/_gambc -o $@ $(LIBRARY_MODULES_C)

$(EXECUTABLE): $(EXECUTABLE_OBJECTS_IN_COMPILE_ORDER) $(LINK_LIBS)
@BUILD_EXE@

_gsc_.c: $(EXECUTABLE_MODULES_C) _$(GAMBCGSCLIB).c
@SETDLPATHBOOT@ $(rootfromhere)/gsc-boot -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -link -l _$(GAMBCGSCLIB) -o $@ $(EXECUTABLE_MODULES_C)

_gsc@obj@: _gsc.c
@BUILD_OBJ@

_gsc_@obj@: _gsc_.c
@BUILD_OBJ@

.c@obj@:
@BUILD_OBJ@ -D___LIBRARY

.scm.c:
@SETDLPATHBOOT@ $(rootfromhere)/gsc-boot -:~~bin=$(srcdirpfx)$(rootfromhere)/bin,~~lib=$(srcdirpfx)$(rootfromhere)/lib,~~include=$(srcdirpfx)$(rootfromhere)/include -f -c @COMPILATION_OPTIONS@ $(srcdirpfx)$*.scm

_gsc.c: $(srcdirpfx)$(rootfromhere)/gsi/main.scm

$(MODULES_C): $(srcdirpfx)$(rootfromhere)/lib/header.scm \
$(srcdirpfx)$(rootfromhere)/lib/gambit\#.scm \
$(srcdirpfx)$(rootfromhere)/lib/_gambit\#.scm \
$(srcdirpfx)_assert\#.scm $(srcdirpfx)_asm\#.scm \
$(srcdirpfx)_x86\#.scm $(srcdirpfx)_codegen\#.scm \
$(srcdirpfx)fixnum.scm $(srcdirpfx)generic.scm

$(MODULES_O): $(srcdirpfx)$(rootfromhere)/include/gambit.h

bootstrap-pre:

bootstrap-post:
rm -f $(rootfromhere)/gsc-boot@bat@ $(rootfromhere)/gsc-boot
cp $(EXECUTABLE) $(rootfromhere)/gsc-boot@exe@
cp $(LIBRARY) $(rootfromhere)/$(LIBRARY)

install-pre:

install-post: all
c_bindir=$(DESTDIR)$(prefix)/bin; \
i_bindir=$(DESTDIR)$(bindir); \
t_bindir=$$i_bindir; \
c_libdir=$(DESTDIR)$(prefix)/lib; \
i_libdir=$(DESTDIR)$(libdir); \
t_libdir=$$i_libdir; \
$(srcdirpfx)$(rootfromhere)/mkidirs $$i_bindir $$i_libdir; \
if test "@ENABLE_SYMLINKS@" = "yes"; then \
$(srcdirpfx)$(rootfromhere)/mkidirs $$c_bindir $$c_libdir; \
t_bindir=$$c_bindir; \
t_libdir=$$c_libdir; \
fi; \
@MAKE_LIBRARY_FOR_INSTALL@; \
for file in $(INSTFILES_LIB_DATA); do \
$(INSTALL_DATA) $$file $$t_libdir/$$file; \
done; \
for file in $(LIBRARIES); do \
$(INSTALL_LIB) $$file $$t_libdir/$$file; \
done; \
@FIXLIB@ $$t_libdir/$(LIBRARY); \
@LINK_FOR_INSTALL@; \
$(INSTALL_PROGRAM) $(EXECUTABLE) $$t_bindir/$(EXECUTABLE_INSTALLED); \
if test "$$t_libdir" != "$$i_libdir"; then \
r_libdir=`$(rootfromhere)/relpath "$$t_libdir" "$$i_libdir" @ENABLE_MULTIPLE_VERSIONS@`; \
for file in $(INSTFILES_LIB_DATA) $(LIBRARIES); do \
(cd $$i_libdir && $(LN_S) $$r_libdir$$file $$file); \
done; \
fi; \
if test "$$t_bindir" != "$$i_bindir"; then \
r_bindir=`$(rootfromhere)/relpath "$$t_bindir" "$$i_bindir" @ENABLE_MULTIPLE_VERSIONS@`; \
for file in $(EXECUTABLE_INSTALLED); do \
(cd $$i_bindir && $(LN_S) $$r_bindir$$file $$file); \
done; \
fi

uninstall-pre:

uninstall-post:
c_bindir=$(DESTDIR)$(prefix)/bin; \
i_bindir=$(DESTDIR)$(bindir); \
t_bindir=$$i_bindir; \
c_libdir=$(DESTDIR)$(prefix)/lib; \
i_libdir=$(DESTDIR)$(libdir); \
t_libdir=$$i_libdir; \
if test "@ENABLE_SYMLINKS@" = "yes"; then \
t_bindir=$$c_bindir; \
t_libdir=$$c_libdir; \
fi; \
for file in $(INSTFILES_LIB_DATA) $(LIBRARIES); do \
rm -f $$t_libdir/$$file; \
done; \
if test "$$t_libdir" != "$$i_libdir"; then \
for file in $(INSTFILES_LIB_DATA) $(LIBRARIES); do \
rm -f $$i_libdir/$$file; \
done; \
fi; \
rm -f $$t_bindir/$(EXECUTABLE_INSTALLED); \
if test "$$t_bindir" != "$$i_bindir"; then \
for file in $(EXECUTABLE_INSTALLED); do \
rm -f $$i_bindir/$$file; \
done; \
fi; \
rmdir $$t_libdir 2> /dev/null; \
if test "$$t_libdir" != "$$i_libdir"; then \
rmdir $$i_libdir 2> /dev/null; \
fi; \
rmdir $$t_bindir 2> /dev/null; \
if test "$$t_bindir" != "$$i_bindir"; then \
rmdir $$i_bindir 2> /dev/null; \
fi

select-gen-for-commit-pre:

select-gen-for-commit-post:
$(RC) update-index --no-assume-unchanged $(GENDISTFILES)

deselect-gen-for-commit-pre:

deselect-gen-for-commit-post:
$(RC) update-index --assume-unchanged $(GENDISTFILES)

mostlyclean-pre:

mostlyclean-post:
rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE)

clean-pre: mostlyclean-pre

clean-post: mostlyclean-post
rm -f *.da *.bb *.bbg *.gcov *.gcno *.gcda

distclean-pre: clean-pre

distclean-post: clean-post

bootclean-pre: distclean-pre

bootclean-post: distclean-post
rm -f $(GENDISTFILES)

realclean-pre: bootclean-pre

realclean-post: bootclean-post
rm -f makefile

rc-setup-pre:
$(RC) add $(RCFILES) $(GENDISTFILES)

rc-setup-post:

dist-pre dist-devel-pre:
mkdir $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot)
chmod 777 $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot)
@echo " Copying distribution files:"
@for file in $(DISTFILES); do \
echo " $(herefromroot)/$$file"; \
ln $(srcdirpfx)$$file $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot) 2> /dev/null \
|| cp -p $(srcdirpfx)$$file $(rootfromhere)/$(PACKAGE_TARNAME)/$(herefromroot); \
done

dist-post dist-devel-post:

all-recursive bootstrap-recursive install-recursive uninstall-recursive select-gen-for-commit-recursive deselect-gen-for-commit-recursive mostlyclean-recursive clean-recursive distclean-recursive bootclean-recursive realclean-recursive rc-setup-recursive dist-recursive dist-devel-recursive:
@if test -n "$(SUBDIRS)"; then \
for subdir in ""$(SUBDIRS); do \
target=`echo $@ | sed 's/-recursive//'`; \
echo making $$target in $$subdir; \
(cd $$subdir && $(MAKE) $$target) || exit 1; \
done \
fi

all: all-post

all-post: all-recursive

all-recursive: all-pre

bootstrap: bootstrap-post

bootstrap-post: bootstrap-recursive

bootstrap-recursive: bootstrap-pre

install: install-post

install-post: install-recursive

install-recursive: install-pre

uninstall: uninstall-post

uninstall-post: uninstall-recursive

uninstall-recursive: uninstall-pre

select-gen-for-commit: select-gen-for-commit-post

select-gen-for-commit-post: select-gen-for-commit-recursive

select-gen-for-commit-recursive: select-gen-for-commit-pre

deselect-gen-for-commit: deselect-gen-for-commit-post

deselect-gen-for-commit-post: deselect-gen-for-commit-recursive

deselect-gen-for-commit-recursive: deselect-gen-for-commit-pre

mostlyclean: mostlyclean-post

mostlyclean-post: mostlyclean-recursive

mostlyclean-recursive: mostlyclean-pre

clean: clean-post

clean-post: clean-recursive

clean-recursive: clean-pre

distclean: distclean-post

distclean-post: distclean-recursive

distclean-recursive: distclean-pre

bootclean: bootclean-post

bootclean-post: bootclean-recursive

bootclean-recursive: bootclean-pre

realclean: realclean-post

realclean-post: realclean-recursive

realclean-recursive: realclean-pre

rc-setup: rc-setup-post

rc-setup-post: rc-setup-recursive

rc-setup-recursive: rc-setup-pre

dist: dist-post

dist-post: dist-recursive

dist-recursive: dist-pre

dist-devel: dist-devel-post

dist-devel-post: dist-devel-recursive

dist-devel-recursive: dist-devel-pre

makefile: makefile.in $(rootfromhere)/config.status
cd $(rootfromhere) && CONFIG_FILES=$(herefromroot)/$@ CONFIG_HEADERS= ./config.status

# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
Something went wrong with that request. Please try again.