~ chicken-core (chicken-5) /rules.make
Trap1# rules.make - basic build rules -*- Makefile -*-2#3# Copyright (c) 2008-2022, The CHICKEN Team4# Copyright (c) 2000-2007, Felix L. Winkelmann5# All rights reserved.6#7# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following8# conditions are met:9#10# Redistributions of source code must retain the above copyright notice, this list of conditions and the following11# disclaimer.12# Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following13# disclaimer in the documentation and/or other materials provided with the distribution.14# Neither the name of the author nor the names of its contributors may be used to endorse or promote15# products derived from this software without specific prior written permission.16#17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS18# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY19# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR20# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR22# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR24# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE25# POSSIBILITY OF SUCH DAMAGE.2627VPATH=$(SRCDIR)2829# Clear Make's default rules for C programs30.SUFFIXES:31%.o : %.c32%: %.o3334# object files3536LIBCHICKEN_SCHEME_OBJECTS_1 = \37 library eval read-syntax repl data-structures pathname port file \38 extras lolevel tcp srfi-4 continuation $(POSIXFILE) internal \39 irregex scheduler debugger-client profiler stub expand modules \40 chicken-syntax chicken-ffi-syntax build-version41LIBCHICKEN_OBJECTS_1 = $(LIBCHICKEN_SCHEME_OBJECTS_1) runtime42LIBCHICKEN_SHARED_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=$(O))43LIBCHICKEN_STATIC_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=-static$(O)) \44 eval-modules-static$(O)4546COMPILER_OBJECTS_1 = \47 chicken batch-driver core optimizer lfa2 compiler-syntax scrutinizer support \48 c-platform c-backend user-pass49COMPILER_OBJECTS = $(COMPILER_OBJECTS_1:=$(O))50COMPILER_STATIC_OBJECTS = $(COMPILER_OBJECTS_1:=-static$(O))5152# "Utility programs" is arbitrary. It includes anything but the "chicken" binary.53# We can't use the INSTALLED_PROGRAMS below because of the possible $(EXE)54# suffix and other possible mangling requested by the user. (is this supported?)55UTILITY_PROGRAM_OBJECTS_1 = \56 csc csi chicken-install chicken-uninstall chicken-status chicken-profile5758# Not all programs built are installed(?) This is the master list that takes59# care of which programs should actually be installed/uninstalled60INSTALLED_PROGRAMS = \61 $(CHICKEN_PROGRAM) $(CSI_PROGRAM) $(CHICKEN_PROFILE_PROGRAM) \62 $(CSC_PROGRAM) \63 $(CHICKEN_DO_PROGRAM) $(CHICKEN_STATUS_PROGRAM) \64 $(CHICKEN_INSTALL_PROGRAM) $(CHICKEN_UNINSTALL_PROGRAM)6566# These generated files make up a bootstrapped distribution build.67# They are not cleaned by the 'clean' target, but only by 'spotless'.68DISTFILES = $(filter-out runtime.c,$(LIBCHICKEN_OBJECTS_1:=.c)) \69 $(UTILITY_PROGRAM_OBJECTS_1:=.c) \70 $(COMPILER_OBJECTS_1:=.c) \71 $(IMPORT_LIBRARIES:=.import.c) \72 $(DYNAMIC_IMPORT_LIBRARIES:=.import.scm) \73 $(foreach lib,$(DYNAMIC_CHICKEN_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \74 $(foreach lib,$(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \75 $(foreach lib,$(COMPILER_OBJECTS_1),chicken.compiler.$(lib).import.scm) \76 eval-modules.c posixunix.c posixwin.c77# Remove the duplicate $(POSIXFILE) entry:78DISTFILES := $(sort $(DISTFILES))7980# library objects8182## Any variable that starts with "declare-" is a meta-rule. When $(call)ed83## it produces output that represents an instantiated rule and recipe.84## This output then needs to be $(eval)ed in order to be added to the85## ruleset evaluated by Make. This allows us to automatically generate86## similar rules for long lists of targets.8788## Note: in some of the rules that follow it is important to add89## $(INCLUDES) last, because on raw mingw (using the DOS shell) the90## backslash in "-I.\" seems to be interpreted as a line-terminator.91## This may be caused by cmd.exe-stupidness or a bug in mingw32-make92## or some other obscure reason.9394define declare-shared-library-object95$(1)$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)96 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \97 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) \98 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \99 $$(INCLUDES)100endef101102# The above meta-rule is reused in the setup API stuff below, so we alias it103declare-libchicken-object = $(declare-shared-library-object)104105$(foreach obj, $(LIBCHICKEN_OBJECTS_1),\106 $(eval $(call declare-libchicken-object,$(obj))))107108# static versions109110define declare-static-library-object111$(1)-static$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)112 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \113 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) \114 $$(C_COMPILER_STATIC_OPTIONS) \115 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \116 $$(INCLUDES)117endef118119declare-static-libchicken-object = $(declare-static-library-object)120121$(foreach obj, $(LIBCHICKEN_OBJECTS_1),\122 $(eval $(call declare-static-libchicken-object,$(obj))))123124$(eval $(call declare-static-libchicken-object,eval-modules))125126# import library objects127128define declare-import-lib-object129$(1).import$(O): $(1).import.c chicken.h $$(CHICKEN_CONFIG_H)130 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \131 -DC_SHARED $$(C_COMPILER_COMPILE_OPTION) \132 $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) \133 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \134 $$(INCLUDES)135endef136137$(foreach obj,$(IMPORT_LIBRARIES),\138 $(eval $(call declare-import-lib-object,$(obj))))139140# compiler objects141142define declare-compiler-object143$(1)$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)144 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \145 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) $$< \146 $$(C_COMPILER_OUTPUT) $$(INCLUDES)147endef148149$(foreach obj, $(COMPILER_OBJECTS_1),\150 $(eval $(call declare-compiler-object,$(obj))))151152# static compiler objects153154define declare-static-compiler-object155$(1)-static$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)156 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \157 $$(C_COMPILER_STATIC_OPTIONS) \158 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \159 $$(INCLUDES)160endef161162$(foreach obj, $(COMPILER_OBJECTS_1),\163 $(eval $(call declare-static-compiler-object,$(obj))))164165# program objects166167define declare-utility-program-object168$(1)$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)169 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) \170 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \171 $$(INCLUDES)172endef173174$(foreach obj, $(UTILITY_PROGRAM_OBJECTS_1),\175 $(eval $(call declare-utility-program-object,$(obj))))176177178# resource objects179180%.rc.o: %.rc181 $(RC_COMPILER) $< $@182183# libraries184185.PHONY: libs186187libs: $(TARGETLIBS)188189lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO): $(LIBCHICKEN_SHARED_OBJECTS)190 $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_LINKER_OPTIONS) \191 $(LINKER_OUTPUT) $^ $(LIBCHICKEN_SO_LIBRARIES)192ifdef USES_SONAME193 ln -sf $(LIBCHICKEN_SO_FILE) $(LIBCHICKEN_SO_FILE).$(BINARYVERSION)194endif195196cyg$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-0.dll: $(LIBCHICKEN_SHARED_OBJECTS)197 $(LINKER) -shared -o $(LIBCHICKEN_SO_FILE) -Wl,--dll -Wl,--add-stdcall-alias \198 -Wl,--enable-stdcall-fixup -Wl,--warn-unresolved-symbols \199 -Wl,--dll-search-prefix=cyg -Wl,--allow-multiple-definition \200 -Wl,--allow-shlib-undefined \201 -Wl,--out-implib=libchicken.dll.a -Wl,--export-all-symbols \202 -Wl,--enable-auto-import \203 -Wl,--whole-archive $(LIBCHICKEN_SHARED_OBJECTS) \204 -Wl,--no-whole-archive $(LIBCHICKEN_SO_LIBRARIES)205206lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A): $(LIBCHICKEN_STATIC_OBJECTS)207 $(LIBRARIAN) $(LIBRARIAN_OPTIONS) $(LIBRARIAN_OUTPUT) $^208209# import libraries and extensions210211%.so: %.o $(LIBCHICKEN_SO_FILE)212 $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_DLOADABLE_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ \213 $(LINKER_LIBRARY_PREFIX)$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(LINKER_LIBRARY_SUFFIX) \214 $(LIBRARIES)215216# executables217218$(CHICKEN_SHARED_EXECUTABLE): $(COMPILER_OBJECTS) $(PRIMARY_LIBCHICKEN)219 $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $(COMPILER_OBJECTS) $(LINKER_OUTPUT) \220 $(LINKER_LIBRARY_PREFIX)$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)221 $(PREINSTALL_PROGRAM_FIXUP) $(CHICKEN_SHARED_EXECUTABLE)222223define declare-program-from-object224$(1)-RC_FILE = $(if $(and $(RC_COMPILER),$(3)),$(2).rc$(O))225226$(1): $(2)$(O) $$(PRIMARY_LIBCHICKEN) $$($(1)-RC_FILE)227 $$(LINKER) $$(LINKER_OPTIONS) $$(LINKER_EXECUTABLE_OPTIONS) $$< \228 $$($(1)-RC_FILE) $$(LINKER_OUTPUT) \229 $$(LINKER_LIBRARY_PREFIX)$$(PROGRAM_PREFIX)chicken$$(PROGRAM_SUFFIX)$$(LINKER_LIBRARY_SUFFIX) \230 $$(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $$(LIBRARIES)231endef232233# Unfortunately, we can't loop over INSTALLED_PROGRAMS here because of234# the possible name mangling and EXE suffixing in there :(235$(eval $(call declare-program-from-object,$(CSI_SHARED_EXECUTABLE),csi))236$(eval $(call declare-program-from-object,$(CHICKEN_INSTALL_PROGRAM)$(EXE),chicken-install,true))237$(eval $(call declare-program-from-object,$(CHICKEN_UNINSTALL_PROGRAM)$(EXE),chicken-uninstall,true))238$(eval $(call declare-program-from-object,$(CHICKEN_STATUS_PROGRAM)$(EXE),chicken-status))239$(eval $(call declare-program-from-object,$(CHICKEN_PROFILE_PROGRAM)$(EXE),chicken-profile))240$(eval $(call declare-program-from-object,$(CSC_PROGRAM)$(EXE),csc))241242# static executables243244$(CHICKEN_STATIC_EXECUTABLE): $(COMPILER_STATIC_OBJECTS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A)245 $(LINKER) $(LINKER_OPTIONS) $(LINKER_STATIC_OPTIONS) $(COMPILER_STATIC_OBJECTS) $(LINKER_OUTPUT) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A) $(LIBRARIES)246247define declare-static-program-from-object248$(1): $(2)$(O) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A)249 $$(LINKER) $$(LINKER_OPTIONS) $$(LINKER_STATIC_OPTIONS) $$< $$(LINKER_OUTPUT) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A) $$(LIBRARIES)250endef251252$(eval $(call declare-program-from-object,$(CSI_STATIC_EXECUTABLE),csi))253254# "chicken-do"255256$(CHICKEN_DO_PROGRAM)$(EXE): $(SRCDIR)chicken-do.c chicken.h $(CHICKEN_CONFIG_H)257 $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< -o $@258259# scripts260261$(CHICKEN_DEBUGGER_PROGRAM): $(SRCDIR)feathers$(SCRIPT_EXT).in262 $(GENERATE_DEBUGGER)263264265# installation266267.PHONY: install uninstall install-libs268.PHONY: install-target install-dev install-bin install-other-files install-wrappers269270install: $(TARGETS) install-target install-bin install-libs install-dev install-other-files271272install-target: install-libs273274install-libs: libs $(LIBCHICKEN_IMPORT_LIBRARY)275 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)"276ifneq ($(LIBCHICKEN_IMPORT_LIBRARY),)277 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) $(LIBCHICKEN_IMPORT_LIBRARY) "$(DESTDIR)$(ILIBDIR)"278endif279ifndef STATICBUILD280ifdef DLLSINPATH281 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)"282 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(IBINDIR)"283else284ifdef USES_SONAME285 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_SO_FILE).$(BINARYVERSION)"286 cd "$(DESTDIR)$(ILIBDIR)" && ln -sf $(LIBCHICKEN_SO_FILE).$(BINARYVERSION) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)287else288 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_SO_FILE)"289endif290endif291endif292293define NL294295296endef # A newline, used to inject recipe lines in a loop. Ugly, but necessary297298install-dev: install-libs299 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)"300 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ISHAREDIR)"301 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IEGGDIR)"302 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)"303 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDATADIR)"304 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A) "$(DESTDIR)$(ILIBDIR)"305ifneq ($(POSTINSTALL_STATIC_LIBRARY),true)306 $(POSTINSTALL_STATIC_LIBRARY) $(POSTINSTALL_STATIC_LIBRARY_FLAGS) "$(ILIBDIR)$(SEP)libchicken$(A)"307endif308 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.h "$(DESTDIR)$(ICHICKENINCDIR)"309 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(CHICKEN_CONFIG_H) "$(DESTDIR)$(ICHICKENINCDIR)"310ifdef WINDOWS311 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.ico "$(DESTDIR)$(IDATADIR)"312 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.rc$(O) "$(DESTDIR)$(IDATADIR)"313endif314 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)types.db "$(DESTDIR)$(IEGGDIR)"315316ifeq ($(NEEDS_RELINKING),yes)317install-bin: $(TARGETS) install-libs install-dev318 $(foreach prog,$(INSTALLED_PROGRAMS),\319 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(prog)$(EXE) $(NL))320321 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(IMPORT_LIBRARIES:%=%.so)322 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(IMPORT_LIBRARIES:%=%.import.so)323 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(LIBCHICKEN_SO_FILE)324 "$(MAKE)" PLATFORM=$(PLATFORM) CONFIG=$(CONFIG) NEEDS_RELINKING=no RUNTIME_LINKER_PATH="$(LIBDIR)" install-bin325# Damn. What was this for, again?326#327# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_PROGRAM)$(EXE) $(CSI_PROGRAM)$(EXE) $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE)328# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_INSTALL_PROGRAM)$(EXE)329# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE)330# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_STATUS_PROGRAM)$(EXE)331else332install-bin: $(TARGETS) install-libs install-dev333 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)"334335 $(foreach prog,$(INSTALLED_PROGRAMS),\336 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) \337 $(prog)$(EXE) "$(DESTDIR)$(IBINDIR)" $(NL))338339 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_DEBUGGER_PROGRAM) "$(DESTDIR)$(IBINDIR)"340341ifdef STATICBUILD342 $(foreach lib,$(IMPORT_LIBRARIES),\343 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) \344 $(lib).import.scm "$(DESTDIR)$(IEGGDIR)" $(NL))345else346 $(foreach lib,$(IMPORT_LIBRARIES),\347 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) \348 $(lib).import.so "$(DESTDIR)$(IEGGDIR)" $(NL))349endif350351ifneq ($(POSTINSTALL_PROGRAM),true)352ifndef STATICBUILD353 $(foreach prog,$(INSTALLED_PROGRAMS),\354 $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) \355 "$(DESTDIR)$(IBINDIR)$(SEP)$(prog)" $(NL))356357 $(foreach import-lib,$(IMPORT_LIBRARIES),\358 $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) \359 "$(DESTDIR)$(IEGGDIR)$(SEP)$(import-lib).import.so" $(NL))360endif361endif362ifeq ($(CROSS_CHICKEN)$(DESTDIR),0)363 -$(IBINDIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM) -defaults $(SRCDIR)setup.defaults -update-db364else365 @echo366 @echo "Warning: cannot run \`$(CHICKEN_INSTALL_PROGRAM) -update-db' when cross-compiling or DESTDIR is set"367 @echo368endif369endif370ifdef WINDOWS_SHELL371 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(SRCDIR)csibatch.bat "$(DESTDIR)$(IBINDIR)"372endif373374install-other-files:375 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)"376 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDOCDIR)"377 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDATADIR)"378379 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROGRAM).1"380 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csc$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSC_PROGRAM).1"381 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csi$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSI_PROGRAM).1"382 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-do$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DO_PROGRAM).1"383 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-install$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM).1"384 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-uninstall$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM).1"385 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-status$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_STATUS_PROGRAM).1"386 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-profile$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM).1"387 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)feathers$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DEBUGGER_PROGRAM).1"388389 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDOCDIR)$(SEP)manual"390 -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)manual-html$(SEP)* "$(DESTDIR)$(IDOCDIR)$(SEP)manual"391 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)README "$(DESTDIR)$(IDOCDIR)"392 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)DEPRECATED "$(DESTDIR)$(IDOCDIR)"393 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)LICENSE "$(DESTDIR)$(IDOCDIR)"394 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)setup.defaults "$(DESTDIR)$(IDATADIR)"395 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)feathers.tcl "$(DESTDIR)$(IDATADIR)"396397install-wrappers:398ifeq ($(WRAPPERDIR),)399 @echo400 @echo Error: WRAPPERDIR is not set401 @echo402 @exit 1403endif404 $(foreach prg, $(INSTALLED_PROGRAMS), \405 $(CSI) -s $(SRCDIR)scripts$(SEP)make-wrapper.scm $(prg) "$(WRAPPERDIR)" $(NL))406407uninstall:408 $(foreach prog,$(INSTALLED_PROGRAMS),\409 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS)\410 "$(DESTDIR)$(IBINDIR)$(SEP)$(prog)$(EXE)" $(NL))411 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_DEBUGGER_PROGRAM)"412 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A)"413 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)"414ifdef USES_SONAME415 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO).$(BINARYVERSION)"416endif417ifdef WINDOWS418 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)"419 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_IMPORT_LIBRARY)"420endif421ifeq ($(PLATFORM),cygwin)422 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)cyg$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)*"423endif424425 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROGRAM).1"426 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSC_PROGRAM).1"427 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSI_PROGRAM).1"428 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DO_PROGRAM).1"429 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM).1"430 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM).1"431 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_STATUS_PROGRAM).1"432 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM).1"433 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DEBUGGER_PROGRAM).1"434435 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)$(SEP)chicken.h"436 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)$(SEP)$(CHICKEN_CONFIG_H)"437 $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) "$(DESTDIR)$(IDATADIR)"438 $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) "$(DESTDIR)$(IEGGDIR)"439ifdef WINDOWS_SHELL440 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)csibatch.bat"441endif442443# build versioning444445ifdef WINDOWS_SHELL446buildbranch:447 echo.$(BRANCHNAME)>buildbranch448buildid:449 echo.$(BUILD_ID)>buildid450else451.PHONY: identify-me452453identify-me:454 @sh $(SRCDIR)identify.sh $(SRCDIR)455456buildbranch: identify-me457buildid: identify-me458endif459460# bootstrapping c sources461462define declare-emitted-import-lib-dependency463.SECONDARY: $(1).import.scm464$(1).import.scm: $(2).c465endef466467define declare-emitted-chicken-import-lib-dependency468$(call declare-emitted-import-lib-dependency,chicken.$(1),$(1))469endef470471define declare-emitted-compiler-import-lib-dependency472$(call declare-emitted-import-lib-dependency,chicken.compiler.$(1),$(1))473endef474475$(foreach lib, $(DYNAMIC_IMPORT_LIBRARIES),\476 $(eval $(call declare-emitted-import-lib-dependency,$(lib),$(lib))))477478$(foreach lib, $(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),\479 $(eval $(call declare-emitted-chicken-import-lib-dependency,$(lib))))480481$(foreach lib, $(COMPILER_OBJECTS_1),\482 $(eval $(call declare-emitted-compiler-import-lib-dependency,$(lib))))483484# special cases for modules not corresponding directly to units485$(eval $(call declare-emitted-import-lib-dependency,chicken.errno,$(POSIXFILE)))486$(eval $(call declare-emitted-import-lib-dependency,chicken.file.posix,$(POSIXFILE)))487$(eval $(call declare-emitted-import-lib-dependency,chicken.time.posix,$(POSIXFILE)))488$(eval $(call declare-emitted-import-lib-dependency,chicken.process,$(POSIXFILE)))489$(eval $(call declare-emitted-import-lib-dependency,chicken.process.signal,$(POSIXFILE)))490$(eval $(call declare-emitted-import-lib-dependency,chicken.process-context.posix,$(POSIXFILE)))491$(eval $(call declare-emitted-import-lib-dependency,chicken.bitwise,library))492$(eval $(call declare-emitted-import-lib-dependency,chicken.blob,library))493$(eval $(call declare-emitted-import-lib-dependency,chicken.fixnum,library))494$(eval $(call declare-emitted-import-lib-dependency,chicken.flonum,library))495$(eval $(call declare-emitted-import-lib-dependency,chicken.gc,library))496$(eval $(call declare-emitted-import-lib-dependency,chicken.keyword,library))497$(eval $(call declare-emitted-import-lib-dependency,chicken.platform,library))498$(eval $(call declare-emitted-import-lib-dependency,chicken.plist,library))499$(eval $(call declare-emitted-import-lib-dependency,chicken.process-context,library))500$(eval $(call declare-emitted-import-lib-dependency,chicken.time,library))501$(eval $(call declare-emitted-import-lib-dependency,chicken.load,eval))502$(eval $(call declare-emitted-import-lib-dependency,chicken.format,extras))503$(eval $(call declare-emitted-import-lib-dependency,chicken.io,extras))504$(eval $(call declare-emitted-import-lib-dependency,chicken.pretty-print,extras))505$(eval $(call declare-emitted-import-lib-dependency,chicken.random,extras))506$(eval $(call declare-emitted-import-lib-dependency,chicken.locative,lolevel))507$(eval $(call declare-emitted-import-lib-dependency,chicken.memory,lolevel))508$(eval $(call declare-emitted-import-lib-dependency,chicken.memory.representation,lolevel))509$(eval $(call declare-emitted-import-lib-dependency,chicken.sort,data-structures))510$(eval $(call declare-emitted-import-lib-dependency,chicken.string,data-structures))511512chicken.c: chicken.scm mini-srfi-1.scm \513 chicken.compiler.batch-driver.import.scm \514 chicken.compiler.c-platform.import.scm \515 chicken.compiler.support.import.scm \516 chicken.compiler.user-pass.import.scm \517 chicken.process-context.import.scm \518 chicken.string.import.scm519batch-driver.c: batch-driver.scm mini-srfi-1.scm \520 chicken.compiler.core.import.scm \521 chicken.compiler.compiler-syntax.import.scm \522 chicken.compiler.optimizer.import.scm \523 chicken.compiler.scrutinizer.import.scm \524 chicken.compiler.c-platform.import.scm \525 chicken.compiler.lfa2.import.scm \526 chicken.compiler.c-backend.import.scm \527 chicken.compiler.support.import.scm \528 chicken.compiler.user-pass.import.scm \529 chicken.format.import.scm \530 chicken.gc.import.scm \531 chicken.internal.import.scm \532 chicken.load.import.scm \533 chicken.pathname.import.scm \534 chicken.platform.import.scm \535 chicken.pretty-print.import.scm \536 chicken.process-context.import.scm \537 chicken.process-context.posix.import.scm \538 chicken.condition.import.scm \539 chicken.port.import.scm \540 chicken.string.import.scm \541 chicken.syntax.import.scm \542 chicken.time.import.scm543c-platform.c: c-platform.scm mini-srfi-1.scm \544 chicken.compiler.optimizer.import.scm \545 chicken.compiler.support.import.scm \546 chicken.compiler.core.import.scm \547 chicken.internal.import.scm548c-backend.c: c-backend.scm mini-srfi-1.scm \549 chicken.compiler.c-platform.import.scm \550 chicken.compiler.support.import.scm \551 chicken.compiler.core.import.scm \552 chicken.bitwise.import.scm \553 chicken.flonum.import.scm \554 chicken.foreign.import.scm \555 chicken.format.import.scm \556 chicken.internal.import.scm \557 chicken.sort.import.scm \558 chicken.string.import.scm \559 chicken.time.import.scm560core.c: core.scm mini-srfi-1.scm \561 chicken.compiler.scrutinizer.import.scm \562 chicken.compiler.support.import.scm \563 chicken.eval.import.scm \564 chicken.file.import.scm \565 chicken.fixnum.import.scm \566 chicken.format.import.scm \567 chicken.io.import.scm \568 chicken.keyword.import.scm \569 chicken.load.import.scm \570 chicken.pretty-print.import.scm \571 chicken.string.import.scm \572 chicken.syntax.import.scm573optimizer.c: optimizer.scm mini-srfi-1.scm \574 chicken.compiler.support.import.scm \575 chicken.fixnum.import.scm \576 chicken.internal.import.scm \577 chicken.sort.import.scm \578 chicken.string.import.scm579scheduler.c: scheduler.scm \580 chicken.fixnum.import.scm \581 chicken.format.import.scm \582 chicken.condition.import.scm583scrutinizer.c: scrutinizer.scm mini-srfi-1.scm \584 chicken.compiler.support.import.scm \585 chicken.fixnum.import.scm \586 chicken.format.import.scm \587 chicken.internal.import.scm \588 chicken.io.import.scm \589 chicken.pathname.import.scm \590 chicken.platform.import.scm \591 chicken.sort.import.scm \592 chicken.port.import.scm \593 chicken.pretty-print.import.scm \594 chicken.string.import.scm595lfa2.c: lfa2.scm mini-srfi-1.scm \596 chicken.compiler.support.import.scm \597 chicken.format.import.scm598compiler-syntax.c: compiler-syntax.scm mini-srfi-1.scm \599 chicken.compiler.support.import.scm \600 chicken.compiler.core.import.scm \601 chicken.fixnum.import.scm \602 chicken.format.import.scm \603 chicken.syntax.import.scm604chicken-ffi-syntax.c: chicken-ffi-syntax.scm \605 chicken.format.import.scm \606 chicken.internal.import.scm \607 chicken.string.import.scm608support.c: support.scm mini-srfi-1.scm \609 chicken.bitwise.import.scm \610 chicken.blob.import.scm \611 chicken.condition.import.scm \612 chicken.file.import.scm \613 chicken.fixnum.import.scm \614 chicken.foreign.import.scm \615 chicken.format.import.scm \616 chicken.internal.import.scm \617 chicken.io.import.scm \618 chicken.keyword.import.scm \619 chicken.pathname.import.scm \620 chicken.platform.import.scm \621 chicken.plist.import.scm \622 chicken.port.import.scm \623 chicken.pretty-print.import.scm \624 chicken.random.import.scm \625 chicken.sort.import.scm \626 chicken.string.import.scm \627 chicken.time.import.scm628modules.c: modules.scm \629 chicken.internal.import.scm \630 chicken.keyword.import.scm \631 chicken.base.import.scm \632 chicken.syntax.import.scm \633 chicken.load.import.scm \634 chicken.platform.import.scm635csc.c: csc.scm \636 chicken.file.import.scm \637 chicken.foreign.import.scm \638 chicken.format.import.scm \639 chicken.io.import.scm \640 chicken.pathname.import.scm \641 chicken.process.import.scm \642 chicken.process-context.import.scm \643 chicken.string.import.scm644csi.c: csi.scm \645 chicken.condition.import.scm \646 chicken.file.import.scm \647 chicken.foreign.import.scm \648 chicken.format.import.scm \649 chicken.gc.import.scm \650 chicken.internal.import.scm \651 chicken.io.import.scm \652 chicken.keyword.import.scm \653 chicken.load.import.scm \654 chicken.platform.import.scm \655 chicken.port.import.scm \656 chicken.pretty-print.import.scm \657 chicken.process.import.scm \658 chicken.process-context.import.scm \659 chicken.repl.import.scm \660 chicken.sort.import.scm \661 chicken.string.import.scm662chicken-profile.c: chicken-profile.scm \663 chicken.internal.import.scm \664 chicken.file.import.scm \665 chicken.file.posix.import.scm \666 chicken.fixnum.import.scm \667 chicken.process-context.import.scm \668 chicken.sort.import.scm \669 chicken.string.import.scm670chicken-status.c: chicken-status.scm \671 chicken.file.import.scm \672 chicken.file.posix.import.scm \673 chicken.fixnum.import.scm \674 chicken.foreign.import.scm \675 chicken.format.import.scm \676 chicken.irregex.import.scm \677 chicken.pathname.import.scm \678 chicken.port.import.scm \679 chicken.pretty-print.import.scm \680 chicken.process-context.import.scm \681 chicken.sort.import.scm \682 chicken.string.import.scm683chicken-install.c: chicken-install.scm \684 chicken.condition.import.scm \685 chicken.file.import.scm \686 chicken.file.posix.import.scm \687 chicken.fixnum.import.scm \688 chicken.foreign.import.scm \689 chicken.format.import.scm \690 chicken.internal.import.scm \691 chicken.io.import.scm \692 chicken.irregex.import.scm \693 chicken.pathname.import.scm \694 chicken.port.import.scm \695 chicken.pretty-print.import.scm \696 chicken.process.import.scm \697 chicken.process-context.import.scm \698 chicken.sort.import.scm \699 chicken.string.import.scm \700 chicken.tcp.import.scm701chicken-uninstall.c: chicken-uninstall.scm \702 chicken.file.import.scm \703 chicken.fixnum.import.scm \704 chicken.foreign.import.scm \705 chicken.format.import.scm \706 chicken.irregex.import.scm \707 chicken.pathname.import.scm \708 chicken.port.import.scm \709 chicken.process.import.scm \710 chicken.process-context.import.scm \711 chicken.string.import.scm712chicken-syntax.c: chicken-syntax.scm \713 chicken.fixnum.import.scm \714 chicken.platform.import.scm \715 chicken.internal.import.scm716srfi-4.c: srfi-4.scm \717 chicken.bitwise.import.scm \718 chicken.fixnum.import.scm \719 chicken.foreign.import.scm \720 chicken.gc.import.scm \721 chicken.platform.import.scm722posixunix.c: posixunix.scm \723 chicken.bitwise.import.scm \724 chicken.condition.import.scm \725 chicken.foreign.import.scm \726 chicken.memory.import.scm \727 chicken.pathname.import.scm \728 chicken.platform.import.scm \729 chicken.port.import.scm \730 chicken.process-context.import.scm \731 chicken.time.import.scm732posixwin.c: posixwin.scm \733 chicken.condition.import.scm \734 chicken.bitwise.import.scm \735 chicken.foreign.import.scm \736 chicken.memory.import.scm \737 chicken.pathname.import.scm \738 chicken.platform.import.scm \739 chicken.port.import.scm \740 chicken.process-context.import.scm \741 chicken.string.import.scm \742 chicken.time.import.scm743data-structures.c: data-structures.scm \744 chicken.condition.import.scm \745 chicken.fixnum.import.scm \746 chicken.foreign.import.scm747expand.c: expand.scm \748 chicken.blob.import.scm \749 chicken.condition.import.scm \750 chicken.fixnum.import.scm \751 chicken.keyword.import.scm \752 chicken.platform.import.scm \753 chicken.string.import.scm \754 chicken.internal.import.scm755extras.c: extras.scm \756 chicken.fixnum.import.scm \757 chicken.string.import.scm \758 chicken.time.import.scm759eval.c: eval.scm \760 chicken.blob.import.scm \761 chicken.condition.import.scm \762 chicken.fixnum.import.scm \763 chicken.foreign.import.scm \764 chicken.internal.import.scm \765 chicken.keyword.import.scm \766 chicken.syntax.import.scm \767 chicken.platform.import.scm768repl.c: repl.scm \769 chicken.eval.import.scm770file.c: file.scm \771 chicken.condition.import.scm \772 chicken.fixnum.import.scm \773 chicken.io.import.scm \774 chicken.irregex.import.scm \775 chicken.foreign.import.scm \776 chicken.pathname.import.scm \777 chicken.process-context.import.scm778lolevel.c: lolevel.scm \779 chicken.fixnum.import.scm \780 chicken.foreign.import.scm781pathname.c: pathname.scm \782 chicken.fixnum.import.scm \783 chicken.irregex.import.scm \784 chicken.platform.import.scm \785 chicken.string.import.scm786port.c: port.scm \787 chicken.fixnum.import.scm \788 chicken.io.import.scm789read-syntax.c: read-syntax.scm \790 chicken.internal.import.scm \791 chicken.platform.import.scm792tcp.c: tcp.scm \793 chicken.fixnum.import.scm \794 chicken.foreign.import.scm \795 chicken.port.import.scm \796 chicken.time.import.scm797eval-modules.c: eval-modules.scm $(DYNAMIC_IMPORT_LIBRARIES:=.import.scm) \798 $(foreach lib,$(DYNAMIC_CHICKEN_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \799 $(foreach lib,$(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),$(lib).c)800continuation.c: continuation.scm \801 chicken.fixnum.import.scm802internal.c: internal.scm \803 chicken.fixnum.import.scm804irregex.c: irregex.scm \805 chicken.fixnum.import.scm \806 chicken.syntax.import.scm807profiler.c: profiler.scm \808 chicken.fixnum.import.scm809stub.c: stub.scm \810 chicken.platform.import.scm811812813define profile-flags814$(if $(filter $(basename $(1)),$(PROFILE_OBJECTS)),-profile)815endef816817bootstrap-lib = $(CHICKEN) $(call profile-flags, $@) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@818819library.c: $(SRCDIR)library.scm820 $(bootstrap-lib) \821 -no-module-registration \822 -emit-import-library chicken.bitwise \823 -emit-import-library chicken.blob \824 -emit-import-library chicken.fixnum \825 -emit-import-library chicken.flonum \826 -emit-import-library chicken.gc \827 -emit-import-library chicken.keyword \828 -emit-import-library chicken.platform \829 -emit-import-library chicken.plist \830 -emit-import-library chicken.process-context831internal.c: $(SRCDIR)internal.scm $(SRCDIR)mini-srfi-1.scm832 $(bootstrap-lib) -emit-import-library chicken.internal833eval.c: $(SRCDIR)eval.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm834 $(bootstrap-lib) \835 -emit-import-library chicken.eval \836 -emit-import-library chicken.load837read-syntax.c: $(SRCDIR)read-syntax.scm $(SRCDIR)common-declarations.scm838 $(bootstrap-lib) -emit-import-library chicken.read-syntax839repl.c: $(SRCDIR)repl.scm $(SRCDIR)common-declarations.scm840 $(bootstrap-lib) -emit-import-library chicken.repl841expand.c: $(SRCDIR)expand.scm $(SRCDIR)synrules.scm $(SRCDIR)common-declarations.scm842 $(bootstrap-lib) \843 -no-module-registration844modules.c: $(SRCDIR)modules.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm845 $(bootstrap-lib)846extras.c: $(SRCDIR)extras.scm $(SRCDIR)common-declarations.scm847 $(bootstrap-lib) \848 -emit-import-library chicken.format \849 -emit-import-library chicken.io \850 -emit-import-library chicken.pretty-print \851 -emit-import-library chicken.random852posixunix.c: $(SRCDIR)posix.scm $(SRCDIR)posixunix.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm853 $(bootstrap-lib) -feature platform-unix \854 -emit-import-library chicken.errno \855 -emit-import-library chicken.file.posix \856 -emit-import-library chicken.time.posix \857 -emit-import-library chicken.process \858 -emit-import-library chicken.process.signal \859 -emit-import-library chicken.process-context.posix \860 -no-module-registration861posixwin.c: $(SRCDIR)posix.scm $(SRCDIR)posixwin.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm862 $(bootstrap-lib) -feature platform-windows \863 -emit-import-library chicken.errno \864 -emit-import-library chicken.file.posix \865 -emit-import-library chicken.time.posix \866 -emit-import-library chicken.process \867 -emit-import-library chicken.process.signal \868 -emit-import-library chicken.process-context.posix \869 -no-module-registration870irregex.c: $(SRCDIR)irregex.scm $(SRCDIR)irregex-core.scm $(SRCDIR)irregex-utils.scm $(SRCDIR)common-declarations.scm871 $(bootstrap-lib) -emit-import-library chicken.irregex872chicken-syntax.c: $(SRCDIR)chicken-syntax.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm873 $(bootstrap-lib)874chicken-ffi-syntax.c: $(SRCDIR)chicken-ffi-syntax.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm875 $(bootstrap-lib)876continuation.c: $(SRCDIR)continuation.scm $(SRCDIR)common-declarations.scm877 $(bootstrap-lib) -emit-import-library chicken.continuation878data-structures.c: $(SRCDIR)data-structures.scm $(SRCDIR)common-declarations.scm879 $(bootstrap-lib) \880 -emit-import-library chicken.sort \881 -emit-import-library chicken.string882pathname.c: $(SRCDIR)pathname.scm $(SRCDIR)common-declarations.scm883 $(bootstrap-lib) -emit-import-library chicken.pathname884port.c: $(SRCDIR)port.scm $(SRCDIR)common-declarations.scm885 $(bootstrap-lib) -emit-import-library chicken.port886file.c: $(SRCDIR)file.scm $(SRCDIR)common-declarations.scm887 $(bootstrap-lib) -emit-import-library chicken.file888lolevel.c: $(SRCDIR)lolevel.scm $(SRCDIR)common-declarations.scm889 $(bootstrap-lib) \890 -emit-import-library chicken.locative \891 -emit-import-library chicken.memory \892 -emit-import-library chicken.memory.representation893tcp.c: $(SRCDIR)tcp.scm $(SRCDIR)common-declarations.scm894 $(bootstrap-lib) -emit-import-library chicken.tcp895srfi-4.c: $(SRCDIR)srfi-4.scm $(SRCDIR)common-declarations.scm896 $(bootstrap-lib) -emit-import-library srfi-4897scheduler.c: $(SRCDIR)scheduler.scm $(SRCDIR)common-declarations.scm898 $(bootstrap-lib)899profiler.c: $(SRCDIR)profiler.scm $(SRCDIR)common-declarations.scm900 $(bootstrap-lib)901stub.c: $(SRCDIR)stub.scm $(SRCDIR)common-declarations.scm902 $(bootstrap-lib)903debugger-client.c: $(SRCDIR)debugger-client.scm $(SRCDIR)common-declarations.scm dbg-stub.c904 $(bootstrap-lib)905build-version.c: $(SRCDIR)build-version.scm $(SRCDIR)buildversion buildbranch buildid906 $(bootstrap-lib)907eval-modules.c: $(SRCDIR)eval-modules.scm $(SRCDIR)common-declarations.scm908 $(bootstrap-lib)909910define declare-bootstrap-import-lib911$(1).import.c: $$(SRCDIR)$(1).import.scm912 $$(CHICKEN) $$< $$(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $$@913endef914915$(foreach obj, $(IMPORT_LIBRARIES),\916 $(eval $(call declare-bootstrap-import-lib,$(obj))))917918# Bootstrap compiler objects919920define declare-bootstrap-compiler-object921$(1).c: $$(SRCDIR)$(1).scm $$(SRCDIR)tweaks.scm922 $$(CHICKEN) $$< $$(CHICKEN_PROGRAM_OPTIONS) -emit-import-library chicken.compiler.$(1) \923 -output-file $$@924endef925926$(foreach obj, $(COMPILER_OBJECTS_1),\927 $(eval $(call declare-bootstrap-compiler-object,$(obj))))928929csi.c: $(SRCDIR)csi.scm $(SRCDIR)banner.scm $(SRCDIR)mini-srfi-1.scm930 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@931chicken-profile.c: $(SRCDIR)chicken-profile.scm $(SRCDIR)mini-srfi-1.scm932 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@933chicken-install.c: $(SRCDIR)chicken-install.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-compile.scm $(SRCDIR)egg-download.scm $(SRCDIR)egg-environment.scm $(SRCDIR)egg-information.scm934 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@935chicken-uninstall.c: $(SRCDIR)chicken-uninstall.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm $(SRCDIR)egg-information.scm936 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@937chicken-status.c: $(SRCDIR)chicken-status.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm $(SRCDIR)egg-information.scm938 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@939csc.c: $(SRCDIR)csc.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm940 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@941942# distribution files943944.PHONY: distfiles dist html945946distfiles: $(DISTFILES)947948dist: distfiles html949 CSI=$(CSI) $(CSI) -s $(SRCDIR)scripts$(SEP)makedist.scm -platform $(PLATFORM) CHICKEN=$(CHICKEN)950951# Jim's `manual-labor' must be installed (just run "chicken-install manual-labor")952html:953 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(SRCDIR)manual-html954 manual-labor $(SRCDIR)manual $(SRCDIR)manual-html955 $(COPY_COMMAND) $(SRCDIR)chicken.png manual-html956 $(COPY_COMMAND) $(SRCDIR)manual.css manual-html957 $(COPY_COMMAND) $(SRCDIR)index.html manual-html958959# cleaning up960961.PHONY: clean spotless confclean testclean962963BUILD_CONFIG_FILES = chicken-config.h chicken-defaults.h chicken-install.rc chicken-uninstall.rc964965clean:966 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(EXE) $(PROGRAM_PREFIX)csi$(PROGRAM_SUFFIX)$(EXE) $(PROGRAM_PREFIX)csc$(PROGRAM_SUFFIX)$(EXE) \967 $(CHICKEN_PROFILE_PROGRAM)$(EXE) \968 $(CHICKEN_INSTALL_PROGRAM)$(EXE) \969 $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) \970 $(CHICKEN_STATUS_PROGRAM)$(EXE) \971 *$(O) \972 $(CHICKEN_DO_PROGRAM)$(EXE) \973 $(CHICKEN_DEBUGGER_PROGRAM) \974 $(LIBCHICKEN_SO_FILE) \975 $(PRIMARY_LIBCHICKEN) \976 lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A) \977 $(IMPORT_LIBRARIES:=.import.so) $(LIBCHICKEN_IMPORT_LIBRARY) \978 $(foreach lib,$(DYNAMIC_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \979 $(BUILD_CONFIG_FILES)980ifdef USES_SONAME981 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX).so.$(BINARYVERSION)982endif983984confclean:985 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(BUILD_CONFIG_FILES)986987spotless: clean testclean988 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DISTFILES) \989 buildid buildbranch990991testclean:992 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) \993 $(SRCDIR)tests$(SEP)*.dll \994 $(SRCDIR)tests$(SEP)*.import.scm \995 $(SRCDIR)tests$(SEP)*.inline \996 $(SRCDIR)tests$(SEP)*.link \997 $(SRCDIR)tests$(SEP)*.o \998 $(SRCDIR)tests$(SEP)*.obj \999 $(SRCDIR)tests$(SEP)*.out \1000 $(SRCDIR)tests$(SEP)*.profile \1001 $(SRCDIR)tests$(SEP)*.redacted \1002 $(SRCDIR)tests$(SEP)*.so \1003 $(SRCDIR)tests$(SEP)tmp \1004 $(SRCDIR)tests$(SEP)tmp.c \1005 $(SRCDIR)tests$(SEP)empty-file \1006 $(SRCDIR)tests$(SEP)null \1007 $(SRCDIR)tests$(SEP)null.c \1008 $(SRCDIR)tests$(SEP)null.exe \1009 $(SRCDIR)tests$(SEP)test-repository \1010 $(SRCDIR)tests$(SEP)redact-gensyms10111012# run tests10131014.PHONY: check10151016export PROGRAM_PREFIX1017export PROGRAM_SUFFIX10181019check: $(TARGETS)1020ifndef WINDOWS_SHELL1021 cd tests; sh runtests.sh1022else1023 cd tests & runtests.bat1024endif10251026# benchmark10271028.PHONY: bench10291030bench: $(CHICKEN_SHARED_EXECUTABLE) $(CSI_SHARED_EXECUTABLE) $(CSC_PROGRAM)$(EXE)1031 cd tests; echo >>bench.log; date >>bench.log; sh runbench.sh 2>&1 | tee -a bench.log103210331034# build static bootstrapping chicken10351036.PHONY: boot-chicken bootclean10371038STAGE1_CONFIG = PLATFORM=$(PLATFORM) PREFIX=/nowhere CONFIG= \1039 CHICKEN=$(CHICKEN) PROGRAM_SUFFIX=-boot-stage1 STATICBUILD=1 \1040 C_COMPILER_OPTIMIZATION_OPTIONS="$(C_COMPILER_OPTIMIZATION_OPTIONS)" BUILDING_CHICKEN_BOOT=110411042BOOT_CONFIG = PLATFORM=$(PLATFORM) PREFIX=/nowhere CONFIG= \1043 CHICKEN=.$(SEP)chicken-boot-stage1$(EXE) PROGRAM_SUFFIX=-boot \1044 STATICBUILD=1 C_COMPILER_OPTIMIZATION_OPTIONS="$(C_COMPILER_OPTIMIZATION_OPTIONS)"10451046boot-chicken:1047 "$(MAKE)" $(STAGE1_CONFIG) confclean1048 "$(MAKE)" $(STAGE1_CONFIG) chicken-boot-stage1$(EXE)1049 "$(MAKE)" $(BOOT_CONFIG) touchfiles1050 "$(MAKE)" $(BOOT_CONFIG) chicken-boot$(EXE)1051 "$(MAKE)" $(BOOT_CONFIG) confclean10521053bootclean:1054 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) \1055 $(SRCDIR)chicken-boot$(EXE) \1056 $(SRCDIR)chicken-boot-stage1$(EXE) \1057 $(SRCDIR)libchicken-boot$(A) \1058 $(SRCDIR)libchicken-boot-stage1$(A)10591060.PHONY: touchfiles10611062touchfiles:1063ifdef WINDOWS_SHELL1064 for %%x in (*.scm) do copy /b %%x +,,1065else1066 touch *.scm1067endif