~ chicken-core (master) /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-version r7lib41LIBCHICKEN_OBJECTS_1 = $(LIBCHICKEN_SCHEME_OBJECTS_1) runtime utf42LIBCHICKEN_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 utf.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.8788define declare-shared-library-object89$(1)$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)90 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \91 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) \92 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \93 $$(INCLUDES)94endef9596# The above meta-rule is reused in the setup API stuff below, so we alias it97declare-libchicken-object = $(declare-shared-library-object)9899$(foreach obj, $(LIBCHICKEN_OBJECTS_1),\100 $(eval $(call declare-libchicken-object,$(obj))))101102# static versions103104define declare-static-library-object105$(1)-static$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)106 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \107 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) \108 $$(C_COMPILER_STATIC_OPTIONS) \109 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \110 $$(INCLUDES)111endef112113declare-static-libchicken-object = $(declare-static-library-object)114115$(foreach obj, $(LIBCHICKEN_OBJECTS_1),\116 $(eval $(call declare-static-libchicken-object,$(obj))))117118$(eval $(call declare-static-libchicken-object,eval-modules))119120# import library objects121122define declare-import-lib-object123$(1).import$(O): $(1).import.c chicken.h $$(CHICKEN_CONFIG_H)124 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \125 -DC_SHARED $$(C_COMPILER_COMPILE_OPTION) \126 $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) \127 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \128 $$(INCLUDES)129endef130131$(foreach obj,$(IMPORT_LIBRARIES),\132 $(eval $(call declare-import-lib-object,$(obj))))133134# compiler objects135136define declare-compiler-object137$(1)$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)138 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \139 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) $$< \140 $$(C_COMPILER_OUTPUT) $$(INCLUDES)141endef142143$(foreach obj, $(COMPILER_OBJECTS_1),\144 $(eval $(call declare-compiler-object,$(obj))))145146# static compiler objects147148define declare-static-compiler-object149$(1)-static$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)150 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \151 $$(C_COMPILER_STATIC_OPTIONS) \152 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \153 $$(INCLUDES)154endef155156$(foreach obj, $(COMPILER_OBJECTS_1),\157 $(eval $(call declare-static-compiler-object,$(obj))))158159# program objects160161define declare-utility-program-object162$(1)$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)163 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) \164 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \165 $$(INCLUDES)166endef167168$(foreach obj, $(UTILITY_PROGRAM_OBJECTS_1),\169 $(eval $(call declare-utility-program-object,$(obj))))170171172# resource objects173174%.rc.o: %.rc175 $(RC_COMPILER) $< $@176177# libraries178179.PHONY: libs180181libs: $(TARGETLIBS)182183lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO): $(LIBCHICKEN_SHARED_OBJECTS)184 $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_LINKER_OPTIONS) \185 $(LINKER_OUTPUT) $^ $(LIBCHICKEN_SO_LIBRARIES)186ifdef USES_SONAME187 ln -sf $(LIBCHICKEN_SO_FILE) $(LIBCHICKEN_SO_FILE).$(BINARYVERSION)188endif189190cyg$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-0.dll: $(LIBCHICKEN_SHARED_OBJECTS)191 $(LINKER) -shared -o $(LIBCHICKEN_SO_FILE) -Wl,--dll -Wl,--add-stdcall-alias \192 -Wl,--enable-stdcall-fixup -Wl,--warn-unresolved-symbols \193 -Wl,--dll-search-prefix=cyg -Wl,--allow-multiple-definition \194 -Wl,--allow-shlib-undefined \195 -Wl,--out-implib=libchicken.dll.a -Wl,--export-all-symbols \196 -Wl,--enable-auto-import \197 -Wl,--whole-archive $(LIBCHICKEN_SHARED_OBJECTS) \198 -Wl,--no-whole-archive $(LIBCHICKEN_SO_LIBRARIES)199200lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A): $(LIBCHICKEN_STATIC_OBJECTS)201 $(LIBRARIAN) $(LIBRARIAN_OPTIONS) $(LIBRARIAN_OUTPUT) $^202203# import libraries and extensions204205%.so: %.o $(LIBCHICKEN_SO_FILE)206 $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_DLOADABLE_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ \207 $(LINKER_LIBRARY_PREFIX)$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(LINKER_LIBRARY_SUFFIX) \208 $(LIBRARIES)209210# executables211212$(CHICKEN_SHARED_EXECUTABLE): $(COMPILER_OBJECTS) $(PRIMARY_LIBCHICKEN)213 $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $(COMPILER_OBJECTS) $(LINKER_OUTPUT) \214 $(LINKER_LIBRARY_PREFIX)$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)215 $(PREINSTALL_PROGRAM_FIXUP) $(CHICKEN_SHARED_EXECUTABLE)216217define declare-program-from-object218$(1)-RC_FILE = $(if $(and $(RC_COMPILER),$(3)),$(2).rc$(O))219220$(1): $(2)$(O) $$(PRIMARY_LIBCHICKEN) $$($(1)-RC_FILE)221 $$(LINKER) $$(LINKER_OPTIONS) $$(LINKER_EXECUTABLE_OPTIONS) $$< \222 $$($(1)-RC_FILE) $$(LINKER_OUTPUT) \223 $$(LINKER_LIBRARY_PREFIX)$$(PROGRAM_PREFIX)chicken$$(PROGRAM_SUFFIX)$$(LINKER_LIBRARY_SUFFIX) \224 $$(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $$(LIBRARIES)225 $(PREINSTALL_PROGRAM_FIXUP) $(1)226endef227228# Unfortunately, we can't loop over INSTALLED_PROGRAMS here because of229# the possible name mangling and EXE suffixing in there :(230$(eval $(call declare-program-from-object,$(CSI_SHARED_EXECUTABLE),csi))231$(eval $(call declare-program-from-object,$(CHICKEN_INSTALL_PROGRAM)$(EXE),chicken-install,true))232$(eval $(call declare-program-from-object,$(CHICKEN_UNINSTALL_PROGRAM)$(EXE),chicken-uninstall,true))233$(eval $(call declare-program-from-object,$(CHICKEN_STATUS_PROGRAM)$(EXE),chicken-status))234$(eval $(call declare-program-from-object,$(CHICKEN_PROFILE_PROGRAM)$(EXE),chicken-profile))235$(eval $(call declare-program-from-object,$(CSC_PROGRAM)$(EXE),csc))236237# static executables238239$(CHICKEN_STATIC_EXECUTABLE): $(COMPILER_STATIC_OBJECTS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)240 $(LINKER) $(LINKER_OPTIONS) $(LINKER_STATIC_OPTIONS) $(COMPILER_STATIC_OBJECTS) $(LINKER_OUTPUT) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) $(LIBRARIES)241242define declare-static-program-from-object243$(1): $(2)$(O) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)244 $$(LINKER) $$(LINKER_OPTIONS) $$(LINKER_STATIC_OPTIONS) $$< $$(LINKER_OUTPUT) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) $$(LIBRARIES)245endef246247$(eval $(call declare-program-from-object,$(CSI_STATIC_EXECUTABLE),csi))248249# "chicken-do"250251$(CHICKEN_DO_PROGRAM)$(EXE): $(SRCDIR)chicken-do.c chicken.h $(CHICKEN_CONFIG_H)252 $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< -o $@253254255# installation256257.PHONY: install uninstall install-libs258.PHONY: install-target install-dev install-bin install-other-files install-wrappers259260install: $(TARGETS) install-target install-bin install-libs install-dev install-other-files261262install-target: install-libs263264install-libs: libs $(LIBCHICKEN_IMPORT_LIBRARY)265 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)"266ifneq ($(LIBCHICKEN_IMPORT_LIBRARY),)267 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) $(LIBCHICKEN_IMPORT_LIBRARY) "$(DESTDIR)$(ILIBDIR)"268endif269ifndef STATICBUILD270ifdef DLLSINPATH271 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)"272 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(IBINDIR)"273else274ifdef USES_SONAME275 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_SO_FILE).$(BINARYVERSION)"276 cd "$(DESTDIR)$(ILIBDIR)" && ln -sf $(LIBCHICKEN_SO_FILE).$(BINARYVERSION) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)277else278 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_SO_FILE)"279endif280endif281endif282283define NL284285286endef # A newline, used to inject recipe lines in a loop. Ugly, but necessary287288install-dev: install-libs289 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)"290 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ISHAREDIR)"291 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IEGGDIR)"292 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)"293 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDATADIR)"294 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) "$(DESTDIR)$(ILIBDIR)"295ifneq ($(POSTINSTALL_STATIC_LIBRARY),true)296 $(POSTINSTALL_STATIC_LIBRARY) $(POSTINSTALL_STATIC_LIBRARY_FLAGS) "$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)"297endif298 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.h "$(DESTDIR)$(ICHICKENINCDIR)"299 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(CHICKEN_CONFIG_H) "$(DESTDIR)$(ICHICKENINCDIR)"300ifdef WINDOWS301 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.ico "$(DESTDIR)$(IDATADIR)"302 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.rc$(O) "$(DESTDIR)$(IDATADIR)"303endif304 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)types.db "$(DESTDIR)$(IEGGDIR)"305306ifeq ($(NEEDS_RELINKING),yes)307install-bin: $(TARGETS) install-libs install-dev308 $(foreach prog,$(INSTALLED_PROGRAMS),\309 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(prog)$(EXE) $(NL))310311 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(IMPORT_LIBRARIES:%=%.so)312 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(IMPORT_LIBRARIES:%=%.import.so)313 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(LIBCHICKEN_SO_FILE)314 "$(MAKE)" PLATFORM=$(PLATFORM) CONFIG=$(CONFIG) NEEDS_RELINKING=no RUNTIME_LINKER_PATH="$(LIBDIR)" install-bin315# Damn. What was this for, again?316#317# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_PROGRAM)$(EXE) $(CSI_PROGRAM)$(EXE) $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE)318# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_INSTALL_PROGRAM)$(EXE)319# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE)320# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_STATUS_PROGRAM)$(EXE)321else322install-bin: $(TARGETS) install-libs install-dev323 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)"324325 $(foreach prog,$(INSTALLED_PROGRAMS),\326 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) \327 $(prog)$(EXE) "$(DESTDIR)$(IBINDIR)" $(NL))328329ifdef STATICBUILD330 $(foreach lib,$(IMPORT_LIBRARIES),\331 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) \332 $(lib).import.scm "$(DESTDIR)$(IEGGDIR)" $(NL))333else334 $(foreach lib,$(IMPORT_LIBRARIES),\335 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) \336 $(lib).import.so "$(DESTDIR)$(IEGGDIR)" $(NL))337endif338339ifneq ($(POSTINSTALL_PROGRAM),true)340ifndef STATICBUILD341 $(foreach prog,$(INSTALLED_PROGRAMS),\342 $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) \343 "$(DESTDIR)$(IBINDIR)$(SEP)$(prog)" $(NL))344345 $(foreach import-lib,$(IMPORT_LIBRARIES),\346 $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) \347 "$(DESTDIR)$(IEGGDIR)$(SEP)$(import-lib).import.so" $(NL))348endif349endif350ifeq ($(CROSS_CHICKEN)$(DESTDIR),0)351 -$(IBINDIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM) -defaults $(SRCDIR)setup.defaults -update-db352else353 @echo354 @echo "Warning: cannot run \`$(CHICKEN_INSTALL_PROGRAM) -update-db' when cross-compiling or DESTDIR is set"355 @echo356endif357endif358359install-other-files:360 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)"361 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDOCDIR)"362 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDATADIR)"363364 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROGRAM).1"365 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csc$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSC_PROGRAM).1"366 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csi$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSI_PROGRAM).1"367 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-do$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DO_PROGRAM).1"368 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-install$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM).1"369 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-uninstall$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM).1"370 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-status$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_STATUS_PROGRAM).1"371 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-profile$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM).1"372373 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDOCDIR)$(SEP)manual"374 -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)manual-html$(SEP)* "$(DESTDIR)$(IDOCDIR)$(SEP)manual"375 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)README "$(DESTDIR)$(IDOCDIR)"376 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)DEPRECATED "$(DESTDIR)$(IDOCDIR)"377 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)LICENSE "$(DESTDIR)$(IDOCDIR)"378 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)setup.defaults "$(DESTDIR)$(IDATADIR)"379380install-wrappers:381ifeq ($(WRAPPERDIR),)382 @echo383 @echo Error: WRAPPERDIR is not set384 @echo385 @exit 1386endif387 $(foreach prg, $(INSTALLED_PROGRAMS), \388 $(CSI) -s $(SRCDIR)scripts$(SEP)make-wrapper.scm $(prg) "$(WRAPPERDIR)" $(NL))389390uninstall:391 $(foreach prog,$(INSTALLED_PROGRAMS),\392 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS)\393 "$(DESTDIR)$(IBINDIR)$(SEP)$(prog)$(EXE)" $(NL))394 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)"395 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)"396ifdef USES_SONAME397 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO).$(BINARYVERSION)"398endif399ifdef WINDOWS400 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)"401 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_IMPORT_LIBRARY)"402endif403ifeq ($(PLATFORM),cygwin)404 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)cyg$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)*"405endif406407 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROGRAM).1"408 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSC_PROGRAM).1"409 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSI_PROGRAM).1"410 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DO_PROGRAM).1"411 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM).1"412 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM).1"413 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_STATUS_PROGRAM).1"414 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM).1"415416 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)$(SEP)chicken.h"417 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)$(SEP)$(CHICKEN_CONFIG_H)"418 $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) "$(DESTDIR)$(IDATADIR)"419 $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) "$(DESTDIR)$(IEGGDIR)"420421# build versioning422423ifdef WINDOWS_SHELL424buildbranch:425 echo.$(BRANCHNAME)>buildbranch426buildid:427 echo.$(BUILD_ID)>buildid428else429.PHONY: identify-me430431identify-me:432 @sh $(SRCDIR)identify.sh $(SRCDIR)433434buildbranch: identify-me435buildid: identify-me436endif437438# bootstrapping c sources439440define declare-emitted-import-lib-dependency441.SECONDARY: $(1).import.scm442$(1).import.scm: $(2).c443endef444445define declare-emitted-chicken-import-lib-dependency446$(call declare-emitted-import-lib-dependency,chicken.$(1),$(1))447endef448449define declare-emitted-compiler-import-lib-dependency450$(call declare-emitted-import-lib-dependency,chicken.compiler.$(1),$(1))451endef452453$(foreach lib, $(DYNAMIC_IMPORT_LIBRARIES),\454 $(eval $(call declare-emitted-import-lib-dependency,$(lib),$(lib))))455456$(foreach lib, $(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),\457 $(eval $(call declare-emitted-chicken-import-lib-dependency,$(lib))))458459$(foreach lib, $(COMPILER_OBJECTS_1),\460 $(eval $(call declare-emitted-compiler-import-lib-dependency,$(lib))))461462# special cases for modules not corresponding directly to units463$(eval $(call declare-emitted-import-lib-dependency,chicken.errno,$(POSIXFILE)))464$(eval $(call declare-emitted-import-lib-dependency,chicken.file.posix,$(POSIXFILE)))465$(eval $(call declare-emitted-import-lib-dependency,chicken.time.posix,$(POSIXFILE)))466$(eval $(call declare-emitted-import-lib-dependency,chicken.process,$(POSIXFILE)))467$(eval $(call declare-emitted-import-lib-dependency,chicken.process.signal,$(POSIXFILE)))468$(eval $(call declare-emitted-import-lib-dependency,chicken.process-context.posix,$(POSIXFILE)))469$(eval $(call declare-emitted-import-lib-dependency,chicken.bitwise,library))470$(eval $(call declare-emitted-import-lib-dependency,chicken.bytevector,library))471$(eval $(call declare-emitted-import-lib-dependency,chicken.fixnum,library))472$(eval $(call declare-emitted-import-lib-dependency,chicken.flonum,library))473$(eval $(call declare-emitted-import-lib-dependency,chicken.gc,library))474$(eval $(call declare-emitted-import-lib-dependency,chicken.keyword,library))475$(eval $(call declare-emitted-import-lib-dependency,chicken.platform,library))476$(eval $(call declare-emitted-import-lib-dependency,chicken.plist,library))477$(eval $(call declare-emitted-import-lib-dependency,chicken.process-context,library))478$(eval $(call declare-emitted-import-lib-dependency,chicken.time,library))479$(eval $(call declare-emitted-import-lib-dependency,chicken.load,eval))480$(eval $(call declare-emitted-import-lib-dependency,chicken.format,extras))481$(eval $(call declare-emitted-import-lib-dependency,chicken.io,library))482$(eval $(call declare-emitted-import-lib-dependency,chicken.pretty-print,extras))483$(eval $(call declare-emitted-import-lib-dependency,chicken.version,extras))484$(eval $(call declare-emitted-import-lib-dependency,chicken.random,extras))485$(eval $(call declare-emitted-import-lib-dependency,chicken.locative,lolevel))486$(eval $(call declare-emitted-import-lib-dependency,chicken.memory,lolevel))487$(eval $(call declare-emitted-import-lib-dependency,chicken.memory.representation,lolevel))488$(eval $(call declare-emitted-import-lib-dependency,chicken.number-vector,srfi-4))489$(eval $(call declare-emitted-import-lib-dependency,chicken.sort,data-structures))490$(eval $(call declare-emitted-import-lib-dependency,chicken.string,data-structures))491$(eval $(call declare-emitted-import-lib-dependency,scheme.write,r7lib))492$(eval $(call declare-emitted-import-lib-dependency,scheme.time,r7lib))493$(eval $(call declare-emitted-import-lib-dependency,scheme.file,r7lib))494$(eval $(call declare-emitted-import-lib-dependency,scheme.process-context,r7lib))495496chicken.c: chicken.scm mini-srfi-1.scm \497 chicken.compiler.batch-driver.import.scm \498 chicken.compiler.c-platform.import.scm \499 chicken.compiler.support.import.scm \500 chicken.compiler.user-pass.import.scm \501 chicken.process-context.import.scm \502 chicken.string.import.scm503batch-driver.c: batch-driver.scm mini-srfi-1.scm \504 chicken.compiler.core.import.scm \505 chicken.compiler.compiler-syntax.import.scm \506 chicken.compiler.optimizer.import.scm \507 chicken.compiler.scrutinizer.import.scm \508 chicken.compiler.c-platform.import.scm \509 chicken.compiler.lfa2.import.scm \510 chicken.compiler.c-backend.import.scm \511 chicken.compiler.support.import.scm \512 chicken.compiler.user-pass.import.scm \513 chicken.format.import.scm \514 chicken.gc.import.scm \515 chicken.internal.import.scm \516 chicken.load.import.scm \517 chicken.pathname.import.scm \518 chicken.platform.import.scm \519 chicken.pretty-print.import.scm \520 chicken.process-context.import.scm \521 chicken.process-context.posix.import.scm \522 chicken.condition.import.scm \523 chicken.port.import.scm \524 chicken.string.import.scm \525 chicken.syntax.import.scm \526 chicken.time.import.scm527c-platform.c: c-platform.scm mini-srfi-1.scm \528 chicken.compiler.optimizer.import.scm \529 chicken.compiler.support.import.scm \530 chicken.compiler.core.import.scm \531 chicken.internal.import.scm532c-backend.c: c-backend.scm mini-srfi-1.scm \533 chicken.compiler.c-platform.import.scm \534 chicken.compiler.support.import.scm \535 chicken.compiler.core.import.scm \536 chicken.bitwise.import.scm \537 chicken.flonum.import.scm \538 chicken.foreign.import.scm \539 chicken.format.import.scm \540 chicken.internal.import.scm \541 chicken.sort.import.scm \542 chicken.string.import.scm \543 chicken.time.import.scm544core.c: core.scm mini-srfi-1.scm \545 chicken.compiler.scrutinizer.import.scm \546 chicken.compiler.support.import.scm \547 chicken.eval.import.scm \548 chicken.file.import.scm \549 chicken.fixnum.import.scm \550 chicken.format.import.scm \551 chicken.io.import.scm \552 chicken.keyword.import.scm \553 chicken.load.import.scm \554 chicken.pretty-print.import.scm \555 chicken.string.import.scm \556 chicken.syntax.import.scm557optimizer.c: optimizer.scm mini-srfi-1.scm \558 chicken.compiler.support.import.scm \559 chicken.fixnum.import.scm \560 chicken.internal.import.scm \561 chicken.sort.import.scm \562 chicken.string.import.scm563scheduler.c: scheduler.scm \564 chicken.fixnum.import.scm \565 chicken.format.import.scm \566 chicken.condition.import.scm567scrutinizer.c: scrutinizer.scm mini-srfi-1.scm \568 chicken.compiler.support.import.scm \569 chicken.fixnum.import.scm \570 chicken.format.import.scm \571 chicken.internal.import.scm \572 chicken.io.import.scm \573 chicken.pathname.import.scm \574 chicken.platform.import.scm \575 chicken.sort.import.scm \576 chicken.port.import.scm \577 chicken.pretty-print.import.scm \578 chicken.string.import.scm579lfa2.c: lfa2.scm mini-srfi-1.scm \580 chicken.compiler.support.import.scm \581 chicken.format.import.scm582compiler-syntax.c: compiler-syntax.scm mini-srfi-1.scm \583 chicken.compiler.support.import.scm \584 chicken.compiler.core.import.scm \585 chicken.fixnum.import.scm \586 chicken.format.import.scm \587 chicken.syntax.import.scm588chicken-ffi-syntax.c: chicken-ffi-syntax.scm \589 chicken.format.import.scm \590 chicken.internal.import.scm \591 chicken.string.import.scm592support.c: support.scm mini-srfi-1.scm \593 chicken.bitwise.import.scm \594 chicken.bytevector.import.scm \595 chicken.condition.import.scm \596 chicken.file.import.scm \597 chicken.fixnum.import.scm \598 chicken.foreign.import.scm \599 chicken.format.import.scm \600 chicken.internal.import.scm \601 chicken.io.import.scm \602 chicken.keyword.import.scm \603 chicken.pathname.import.scm \604 chicken.platform.import.scm \605 chicken.plist.import.scm \606 chicken.port.import.scm \607 chicken.pretty-print.import.scm \608 chicken.random.import.scm \609 chicken.sort.import.scm \610 chicken.string.import.scm \611 chicken.time.import.scm612modules.c: modules.scm \613 chicken.internal.import.scm \614 chicken.format.import.scm \615 chicken.keyword.import.scm \616 chicken.base.import.scm \617 chicken.syntax.import.scm \618 chicken.load.import.scm \619 chicken.platform.import.scm620csc.c: csc.scm \621 chicken.file.import.scm \622 chicken.foreign.import.scm \623 chicken.format.import.scm \624 chicken.io.import.scm \625 chicken.pathname.import.scm \626 chicken.process.import.scm \627 chicken.process-context.import.scm \628 chicken.string.import.scm629csi.c: csi.scm \630 chicken.condition.import.scm \631 chicken.file.import.scm \632 chicken.foreign.import.scm \633 chicken.format.import.scm \634 chicken.gc.import.scm \635 chicken.internal.import.scm \636 chicken.io.import.scm \637 chicken.keyword.import.scm \638 chicken.load.import.scm \639 chicken.platform.import.scm \640 chicken.port.import.scm \641 chicken.pretty-print.import.scm \642 chicken.process.import.scm \643 chicken.process-context.import.scm \644 chicken.repl.import.scm \645 chicken.sort.import.scm \646 chicken.string.import.scm \647 scheme.write.import.scm648chicken-profile.c: chicken-profile.scm \649 chicken.internal.import.scm \650 chicken.file.import.scm \651 chicken.file.posix.import.scm \652 chicken.fixnum.import.scm \653 chicken.process-context.import.scm \654 chicken.sort.import.scm \655 chicken.string.import.scm656chicken-status.c: chicken-status.scm \657 chicken.file.import.scm \658 chicken.file.posix.import.scm \659 chicken.fixnum.import.scm \660 chicken.foreign.import.scm \661 chicken.format.import.scm \662 chicken.irregex.import.scm \663 chicken.pathname.import.scm \664 chicken.port.import.scm \665 chicken.pretty-print.import.scm \666 chicken.process-context.import.scm \667 chicken.sort.import.scm \668 chicken.string.import.scm669chicken-install.c: chicken-install.scm \670 chicken.condition.import.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.internal.import.scm \677 chicken.io.import.scm \678 chicken.irregex.import.scm \679 chicken.pathname.import.scm \680 chicken.port.import.scm \681 chicken.pretty-print.import.scm \682 chicken.process.import.scm \683 chicken.process-context.import.scm \684 chicken.sort.import.scm \685 chicken.string.import.scm \686 chicken.version.import.scm \687 chicken.tcp.import.scm688chicken-uninstall.c: chicken-uninstall.scm \689 chicken.file.import.scm \690 chicken.fixnum.import.scm \691 chicken.foreign.import.scm \692 chicken.format.import.scm \693 chicken.irregex.import.scm \694 chicken.pathname.import.scm \695 chicken.port.import.scm \696 chicken.process.import.scm \697 chicken.process-context.import.scm \698 chicken.string.import.scm699chicken-syntax.c: chicken-syntax.scm \700 chicken.fixnum.import.scm \701 chicken.platform.import.scm \702 chicken.internal.import.scm703srfi-4.c: srfi-4.scm \704 chicken.bitwise.import.scm \705 chicken.bytevector.import.scm \706 chicken.fixnum.import.scm \707 chicken.foreign.import.scm \708 chicken.gc.import.scm \709 chicken.platform.import.scm710posixunix.c: posixunix.scm \711 chicken.bitwise.import.scm \712 chicken.condition.import.scm \713 chicken.foreign.import.scm \714 chicken.memory.import.scm \715 chicken.pathname.import.scm \716 chicken.platform.import.scm \717 chicken.port.import.scm \718 chicken.process-context.import.scm \719 chicken.time.import.scm720posixwin.c: posixwin.scm \721 chicken.condition.import.scm \722 chicken.bitwise.import.scm \723 chicken.foreign.import.scm \724 chicken.memory.import.scm \725 chicken.pathname.import.scm \726 chicken.platform.import.scm \727 chicken.port.import.scm \728 chicken.process-context.import.scm \729 chicken.string.import.scm \730 chicken.time.import.scm731data-structures.c: data-structures.scm \732 chicken.condition.import.scm \733 chicken.fixnum.import.scm \734 chicken.foreign.import.scm735expand.c: expand.scm \736 chicken.bytevector.import.scm \737 chicken.condition.import.scm \738 chicken.fixnum.import.scm \739 chicken.keyword.import.scm \740 chicken.platform.import.scm \741 chicken.string.import.scm \742 chicken.internal.import.scm743extras.c: extras.scm \744 chicken.fixnum.import.scm \745 chicken.string.import.scm \746 chicken.time.import.scm747eval.c: eval.scm \748 chicken.bytevector.import.scm \749 chicken.condition.import.scm \750 chicken.fixnum.import.scm \751 chicken.foreign.import.scm \752 chicken.internal.import.scm \753 chicken.keyword.import.scm \754 chicken.syntax.import.scm \755 chicken.platform.import.scm756repl.c: repl.scm \757 chicken.eval.import.scm758file.c: file.scm \759 chicken.condition.import.scm \760 chicken.fixnum.import.scm \761 chicken.io.import.scm \762 chicken.irregex.import.scm \763 chicken.foreign.import.scm \764 chicken.pathname.import.scm \765 chicken.process-context.import.scm766lolevel.c: lolevel.scm \767 chicken.fixnum.import.scm \768 chicken.foreign.import.scm769pathname.c: pathname.scm \770 chicken.fixnum.import.scm \771 chicken.irregex.import.scm \772 chicken.platform.import.scm \773 chicken.string.import.scm774port.c: port.scm \775 chicken.fixnum.import.scm \776 chicken.io.import.scm777read-syntax.c: read-syntax.scm \778 chicken.internal.import.scm \779 chicken.platform.import.scm780tcp.c: tcp.scm \781 chicken.fixnum.import.scm \782 chicken.foreign.import.scm \783 chicken.port.import.scm \784 chicken.time.import.scm785eval-modules.c: eval-modules.scm $(DYNAMIC_IMPORT_LIBRARIES:=.import.scm) \786 $(foreach lib,$(DYNAMIC_CHICKEN_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \787 $(foreach lib,$(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),$(lib).c)788continuation.c: continuation.scm \789 chicken.fixnum.import.scm790internal.c: internal.scm \791 chicken.fixnum.import.scm792irregex.c: irregex.scm \793 chicken.fixnum.import.scm \794 chicken.syntax.import.scm795profiler.c: profiler.scm \796 chicken.fixnum.import.scm797stub.c: stub.scm \798 chicken.platform.import.scm799r7lib.c: r7lib.scm \800 chicken.platform.import.scm \801 chicken.process-context.import.scm \802 chicken.time.import.scm \803 chicken.io.import.scm \804 chicken.file.import.scm805806define profile-flags807$(if $(filter $(basename $(1)),$(PROFILE_OBJECTS)),-profile)808endef809810bootstrap-lib = $(CHICKEN) $(call profile-flags, $@) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@811812library.c: $(SRCDIR)library.scm813 $(bootstrap-lib) \814 -no-module-registration \815 -emit-import-library chicken.bitwise \816 -emit-import-library chicken.bytevector \817 -emit-import-library chicken.fixnum \818 -emit-import-library chicken.flonum \819 -emit-import-library chicken.gc \820 -emit-import-library chicken.keyword \821 -emit-import-library chicken.platform \822 -emit-import-library chicken.plist \823 -emit-import-library chicken.io \824 -emit-import-library chicken.process-context825internal.c: $(SRCDIR)internal.scm $(SRCDIR)mini-srfi-1.scm826 $(bootstrap-lib) -emit-import-library chicken.internal827eval.c: $(SRCDIR)eval.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm828 $(bootstrap-lib) \829 -emit-import-library chicken.eval \830 -emit-import-library chicken.load831r7lib.c: $(SRCDIR)r7lib.scm $(SRCDIR)common-declarations.scm832 $(bootstrap-lib) -emit-import-library scheme.write \833 -emit-import-library scheme.time \834 -emit-import-library scheme.file \835 -emit-import-library scheme.process-context836read-syntax.c: $(SRCDIR)read-syntax.scm $(SRCDIR)common-declarations.scm837 $(bootstrap-lib) -emit-import-library chicken.read-syntax838repl.c: $(SRCDIR)repl.scm $(SRCDIR)common-declarations.scm839 $(bootstrap-lib) -emit-import-library chicken.repl840expand.c: $(SRCDIR)expand.scm $(SRCDIR)synrules.scm $(SRCDIR)common-declarations.scm841 $(bootstrap-lib) \842 -no-module-registration843modules.c: $(SRCDIR)modules.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm844 $(bootstrap-lib)845extras.c: $(SRCDIR)extras.scm $(SRCDIR)common-declarations.scm846 $(bootstrap-lib) \847 -emit-import-library chicken.format \848 -emit-import-library chicken.pretty-print \849 -emit-import-library chicken.random \850 -emit-import-library chicken.version851posixunix.c: $(SRCDIR)posix.scm $(SRCDIR)posixunix.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm852 $(bootstrap-lib) -feature platform-unix \853 -emit-import-library chicken.errno \854 -emit-import-library chicken.file.posix \855 -emit-import-library chicken.time.posix \856 -emit-import-library chicken.process \857 -emit-import-library chicken.process.signal \858 -emit-import-library chicken.process-context.posix \859 -no-module-registration860posixwin.c: $(SRCDIR)posix.scm $(SRCDIR)posixwin.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm861 $(bootstrap-lib) -feature platform-windows \862 -emit-import-library chicken.errno \863 -emit-import-library chicken.file.posix \864 -emit-import-library chicken.time.posix \865 -emit-import-library chicken.process \866 -emit-import-library chicken.process.signal \867 -emit-import-library chicken.process-context.posix \868 -no-module-registration869irregex.c: $(SRCDIR)irregex.scm $(SRCDIR)irregex-core.scm $(SRCDIR)irregex-utils.scm $(SRCDIR)common-declarations.scm870 $(bootstrap-lib) -emit-import-library chicken.irregex871chicken-syntax.c: $(SRCDIR)chicken-syntax.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm872 $(bootstrap-lib)873chicken-ffi-syntax.c: $(SRCDIR)chicken-ffi-syntax.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm874 $(bootstrap-lib)875continuation.c: $(SRCDIR)continuation.scm $(SRCDIR)common-declarations.scm876 $(bootstrap-lib) -emit-import-library chicken.continuation877data-structures.c: $(SRCDIR)data-structures.scm $(SRCDIR)common-declarations.scm878 $(bootstrap-lib) \879 -emit-import-library chicken.sort \880 -emit-import-library chicken.string881pathname.c: $(SRCDIR)pathname.scm $(SRCDIR)common-declarations.scm882 $(bootstrap-lib) -emit-import-library chicken.pathname883port.c: $(SRCDIR)port.scm $(SRCDIR)common-declarations.scm884 $(bootstrap-lib) -emit-import-library chicken.port885file.c: $(SRCDIR)file.scm $(SRCDIR)common-declarations.scm886 $(bootstrap-lib) -emit-import-library chicken.file887lolevel.c: $(SRCDIR)lolevel.scm $(SRCDIR)common-declarations.scm888 $(bootstrap-lib) \889 -emit-import-library chicken.locative \890 -emit-import-library chicken.memory \891 -emit-import-library chicken.memory.representation892tcp.c: $(SRCDIR)tcp.scm $(SRCDIR)common-declarations.scm893 $(bootstrap-lib) -emit-import-library chicken.tcp894srfi-4.c: $(SRCDIR)srfi-4.scm $(SRCDIR)common-declarations.scm895 $(bootstrap-lib) -emit-import-library srfi-4 \896 -emit-import-library chicken.number-vector897scheduler.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 echo '# this file is intentionally empty' > config.make950 CSI=$(CSI) $(CSI) -s $(SRCDIR)scripts$(SEP)makedist.scm -platform $(PLATFORM) CHICKEN=$(CHICKEN)951952# Jim's `manual-labor' must be installed (just run "chicken-install manual-labor")953html:954 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(SRCDIR)manual-html955 manual-labor $(SRCDIR)manual $(SRCDIR)manual-html956 $(COPY_COMMAND) $(SRCDIR)chicken.png manual-html957 $(COPY_COMMAND) $(SRCDIR)manual.css manual-html958 $(COPY_COMMAND) $(SRCDIR)index.html manual-html959960# cleaning up961962.PHONY: clean spotless confclean testclean963964BUILD_CONFIG_FILES = chicken-config.h chicken-defaults.h chicken-install.rc chicken-uninstall.rc965966clean:967 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(EXE) $(PROGRAM_PREFIX)csi$(PROGRAM_SUFFIX)$(EXE) $(PROGRAM_PREFIX)csc$(PROGRAM_SUFFIX)$(EXE) \968 $(CHICKEN_PROFILE_PROGRAM)$(EXE) \969 $(CHICKEN_INSTALL_PROGRAM)$(EXE) \970 $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) \971 $(CHICKEN_STATUS_PROGRAM)$(EXE) \972 *$(O) \973 $(CHICKEN_DO_PROGRAM)$(EXE) \974 $(LIBCHICKEN_SO_FILE) \975 $(PRIMARY_LIBCHICKEN) \976 lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(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)986 touch config.make987988spotless: clean testclean989 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DISTFILES) \990 buildid buildbranch991992testclean:993 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) \994 $(SRCDIR)tests$(SEP)*.dll \995 $(SRCDIR)tests$(SEP)*.import.scm \996 $(SRCDIR)tests$(SEP)*.inline \997 $(SRCDIR)tests$(SEP)*.link \998 $(SRCDIR)tests$(SEP)*.o \999 $(SRCDIR)tests$(SEP)*.obj \1000 $(SRCDIR)tests$(SEP)*.out \1001 $(SRCDIR)tests$(SEP)*.profile \1002 $(SRCDIR)tests$(SEP)*.redacted \1003 $(SRCDIR)tests$(SEP)*.so \1004 $(SRCDIR)tests$(SEP)tmp \1005 $(SRCDIR)tests$(SEP)tmp.c \1006 $(SRCDIR)tests$(SEP)empty-file \1007 $(SRCDIR)tests$(SEP)null \1008 $(SRCDIR)tests$(SEP)null.c \1009 $(SRCDIR)tests$(SEP)null.exe \1010 $(SRCDIR)tests$(SEP)test-repository \1011 $(SRCDIR)tests$(SEP)redact-gensyms10121013# run tests10141015.PHONY: check10161017export PROGRAM_PREFIX1018export PROGRAM_SUFFIX10191020check: $(TARGETS)1021 cd tests; sh runtests.sh10221023# benchmark10241025.PHONY: bench10261027bench: $(CHICKEN_SHARED_EXECUTABLE) $(CSI_SHARED_EXECUTABLE) $(CSC_PROGRAM)$(EXE)1028 cd tests; echo >>bench.log; date >>bench.log; sh runbench.sh 2>&1 | tee -a bench.log102910301031# build static bootstrapping chicken10321033.PHONY: boot-chicken bootclean10341035STAGE1_CONFIG = PLATFORM=$(PLATFORM) PREFIX=/nowhere CONFIG= \1036 CHICKEN=$(CHICKEN) PROGRAM_SUFFIX=-boot-stage1 STATICBUILD=1 \1037 C_COMPILER_OPTIMIZATION_OPTIONS="$(C_COMPILER_OPTIMIZATION_OPTIONS)" BUILDING_CHICKEN_BOOT=110381039BOOT_CONFIG = PLATFORM=$(PLATFORM) PREFIX=/nowhere CONFIG= \1040 CHICKEN=.$(SEP)chicken-boot-stage1$(EXE) PROGRAM_SUFFIX=-boot \1041 STATICBUILD=1 C_COMPILER_OPTIMIZATION_OPTIONS="$(C_COMPILER_OPTIMIZATION_OPTIONS)"10421043boot-chicken:1044 "$(MAKE)" $(STAGE1_CONFIG) confclean1045 "$(MAKE)" $(STAGE1_CONFIG) chicken-boot-stage1$(EXE)1046 "$(MAKE)" $(BOOT_CONFIG) touchfiles1047 "$(MAKE)" $(BOOT_CONFIG) chicken-boot$(EXE)1048 "$(MAKE)" $(BOOT_CONFIG) confclean10491050bootclean:1051 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) \1052 $(SRCDIR)chicken-boot$(EXE) \1053 $(SRCDIR)chicken-boot-stage1$(EXE) \1054 $(SRCDIR)libchicken-boot$(A) \1055 $(SRCDIR)libchicken-boot-stage1$(A)10561057.PHONY: touchfiles10581059touchfiles:1060ifdef WINDOWS_SHELL1061 for %%x in (*.scm) do copy /b %%x +,,1062else1063 touch *.scm1064endif