~ 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)225endef226227# Unfortunately, we can't loop over INSTALLED_PROGRAMS here because of228# the possible name mangling and EXE suffixing in there :(229$(eval $(call declare-program-from-object,$(CSI_SHARED_EXECUTABLE),csi))230$(eval $(call declare-program-from-object,$(CHICKEN_INSTALL_PROGRAM)$(EXE),chicken-install,true))231$(eval $(call declare-program-from-object,$(CHICKEN_UNINSTALL_PROGRAM)$(EXE),chicken-uninstall,true))232$(eval $(call declare-program-from-object,$(CHICKEN_STATUS_PROGRAM)$(EXE),chicken-status))233$(eval $(call declare-program-from-object,$(CHICKEN_PROFILE_PROGRAM)$(EXE),chicken-profile))234$(eval $(call declare-program-from-object,$(CSC_PROGRAM)$(EXE),csc))235236# static executables237238$(CHICKEN_STATIC_EXECUTABLE): $(COMPILER_STATIC_OBJECTS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)239 $(LINKER) $(LINKER_OPTIONS) $(LINKER_STATIC_OPTIONS) $(COMPILER_STATIC_OBJECTS) $(LINKER_OUTPUT) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) $(LIBRARIES)240241define declare-static-program-from-object242$(1): $(2)$(O) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)243 $$(LINKER) $$(LINKER_OPTIONS) $$(LINKER_STATIC_OPTIONS) $$< $$(LINKER_OUTPUT) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) $$(LIBRARIES)244endef245246$(eval $(call declare-program-from-object,$(CSI_STATIC_EXECUTABLE),csi))247248# "chicken-do"249250$(CHICKEN_DO_PROGRAM)$(EXE): $(SRCDIR)chicken-do.c chicken.h $(CHICKEN_CONFIG_H)251 $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< -o $@252253254# installation255256.PHONY: install uninstall install-libs257.PHONY: install-target install-dev install-bin install-other-files install-wrappers258259install: $(TARGETS) install-target install-bin install-libs install-dev install-other-files260261install-target: install-libs262263install-libs: libs $(LIBCHICKEN_IMPORT_LIBRARY)264 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)"265ifneq ($(LIBCHICKEN_IMPORT_LIBRARY),)266 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) $(LIBCHICKEN_IMPORT_LIBRARY) "$(DESTDIR)$(ILIBDIR)"267endif268ifndef STATICBUILD269ifdef DLLSINPATH270 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)"271 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(IBINDIR)"272else273ifdef USES_SONAME274 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_SO_FILE).$(BINARYVERSION)"275 cd "$(DESTDIR)$(ILIBDIR)" && ln -sf $(LIBCHICKEN_SO_FILE).$(BINARYVERSION) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)276else277 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_SO_FILE)"278endif279endif280endif281282define NL283284285endef # A newline, used to inject recipe lines in a loop. Ugly, but necessary286287install-dev: install-libs288 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)"289 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ISHAREDIR)"290 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IEGGDIR)"291 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)"292 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDATADIR)"293 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) "$(DESTDIR)$(ILIBDIR)"294ifneq ($(POSTINSTALL_STATIC_LIBRARY),true)295 $(POSTINSTALL_STATIC_LIBRARY) $(POSTINSTALL_STATIC_LIBRARY_FLAGS) "$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)"296endif297 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.h "$(DESTDIR)$(ICHICKENINCDIR)"298 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(CHICKEN_CONFIG_H) "$(DESTDIR)$(ICHICKENINCDIR)"299ifdef WINDOWS300 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.ico "$(DESTDIR)$(IDATADIR)"301 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.rc$(O) "$(DESTDIR)$(IDATADIR)"302endif303 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)types.db "$(DESTDIR)$(IEGGDIR)"304305ifeq ($(NEEDS_RELINKING),yes)306install-bin: $(TARGETS) install-libs install-dev307 $(foreach prog,$(INSTALLED_PROGRAMS),\308 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(prog)$(EXE) $(NL))309310 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(IMPORT_LIBRARIES:%=%.so)311 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(IMPORT_LIBRARIES:%=%.import.so)312 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(LIBCHICKEN_SO_FILE)313 "$(MAKE)" PLATFORM=$(PLATFORM) CONFIG=$(CONFIG) NEEDS_RELINKING=no RUNTIME_LINKER_PATH="$(LIBDIR)" install-bin314# Damn. What was this for, again?315#316# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_PROGRAM)$(EXE) $(CSI_PROGRAM)$(EXE) $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE)317# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_INSTALL_PROGRAM)$(EXE)318# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE)319# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_STATUS_PROGRAM)$(EXE)320else321install-bin: $(TARGETS) install-libs install-dev322 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)"323324 $(foreach prog,$(INSTALLED_PROGRAMS),\325 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) \326 $(prog)$(EXE) "$(DESTDIR)$(IBINDIR)" $(NL))327328ifdef STATICBUILD329 $(foreach lib,$(IMPORT_LIBRARIES),\330 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) \331 $(lib).import.scm "$(DESTDIR)$(IEGGDIR)" $(NL))332else333 $(foreach lib,$(IMPORT_LIBRARIES),\334 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) \335 $(lib).import.so "$(DESTDIR)$(IEGGDIR)" $(NL))336endif337338ifneq ($(POSTINSTALL_PROGRAM),true)339ifndef STATICBUILD340 $(foreach prog,$(INSTALLED_PROGRAMS),\341 $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) \342 "$(DESTDIR)$(IBINDIR)$(SEP)$(prog)" $(NL))343344 $(foreach import-lib,$(IMPORT_LIBRARIES),\345 $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) \346 "$(DESTDIR)$(IEGGDIR)$(SEP)$(import-lib).import.so" $(NL))347endif348endif349ifeq ($(CROSS_CHICKEN)$(DESTDIR),0)350 -$(IBINDIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM) -defaults $(SRCDIR)setup.defaults -update-db351else352 @echo353 @echo "Warning: cannot run \`$(CHICKEN_INSTALL_PROGRAM) -update-db' when cross-compiling or DESTDIR is set"354 @echo355endif356endif357358install-other-files:359 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)"360 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDOCDIR)"361 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDATADIR)"362363 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROGRAM).1"364 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csc$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSC_PROGRAM).1"365 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csi$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSI_PROGRAM).1"366 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-do$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DO_PROGRAM).1"367 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-install$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM).1"368 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-uninstall$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM).1"369 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-status$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_STATUS_PROGRAM).1"370 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-profile$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM).1"371372 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDOCDIR)$(SEP)manual"373 -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)manual-html$(SEP)* "$(DESTDIR)$(IDOCDIR)$(SEP)manual"374 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)README "$(DESTDIR)$(IDOCDIR)"375 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)DEPRECATED "$(DESTDIR)$(IDOCDIR)"376 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)LICENSE "$(DESTDIR)$(IDOCDIR)"377 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)setup.defaults "$(DESTDIR)$(IDATADIR)"378379install-wrappers:380ifeq ($(WRAPPERDIR),)381 @echo382 @echo Error: WRAPPERDIR is not set383 @echo384 @exit 1385endif386 $(foreach prg, $(INSTALLED_PROGRAMS), \387 $(CSI) -s $(SRCDIR)scripts$(SEP)make-wrapper.scm $(prg) "$(WRAPPERDIR)" $(NL))388389uninstall:390 $(foreach prog,$(INSTALLED_PROGRAMS),\391 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS)\392 "$(DESTDIR)$(IBINDIR)$(SEP)$(prog)$(EXE)" $(NL))393 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)"394 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)"395ifdef USES_SONAME396 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO).$(BINARYVERSION)"397endif398ifdef WINDOWS399 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)"400 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_IMPORT_LIBRARY)"401endif402ifeq ($(PLATFORM),cygwin)403 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)cyg$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)*"404endif405406 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROGRAM).1"407 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSC_PROGRAM).1"408 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSI_PROGRAM).1"409 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DO_PROGRAM).1"410 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM).1"411 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM).1"412 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_STATUS_PROGRAM).1"413 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM).1"414415 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)$(SEP)chicken.h"416 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)$(SEP)$(CHICKEN_CONFIG_H)"417 $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) "$(DESTDIR)$(IDATADIR)"418 $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) "$(DESTDIR)$(IEGGDIR)"419420# build versioning421422ifdef WINDOWS_SHELL423buildbranch:424 echo.$(BRANCHNAME)>buildbranch425buildid:426 echo.$(BUILD_ID)>buildid427else428.PHONY: identify-me429430identify-me:431 @sh $(SRCDIR)identify.sh $(SRCDIR)432433buildbranch: identify-me434buildid: identify-me435endif436437# bootstrapping c sources438439define declare-emitted-import-lib-dependency440.SECONDARY: $(1).import.scm441$(1).import.scm: $(2).c442endef443444define declare-emitted-chicken-import-lib-dependency445$(call declare-emitted-import-lib-dependency,chicken.$(1),$(1))446endef447448define declare-emitted-compiler-import-lib-dependency449$(call declare-emitted-import-lib-dependency,chicken.compiler.$(1),$(1))450endef451452$(foreach lib, $(DYNAMIC_IMPORT_LIBRARIES),\453 $(eval $(call declare-emitted-import-lib-dependency,$(lib),$(lib))))454455$(foreach lib, $(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),\456 $(eval $(call declare-emitted-chicken-import-lib-dependency,$(lib))))457458$(foreach lib, $(COMPILER_OBJECTS_1),\459 $(eval $(call declare-emitted-compiler-import-lib-dependency,$(lib))))460461# special cases for modules not corresponding directly to units462$(eval $(call declare-emitted-import-lib-dependency,chicken.errno,$(POSIXFILE)))463$(eval $(call declare-emitted-import-lib-dependency,chicken.file.posix,$(POSIXFILE)))464$(eval $(call declare-emitted-import-lib-dependency,chicken.time.posix,$(POSIXFILE)))465$(eval $(call declare-emitted-import-lib-dependency,chicken.process,$(POSIXFILE)))466$(eval $(call declare-emitted-import-lib-dependency,chicken.process.signal,$(POSIXFILE)))467$(eval $(call declare-emitted-import-lib-dependency,chicken.process-context.posix,$(POSIXFILE)))468$(eval $(call declare-emitted-import-lib-dependency,chicken.bitwise,library))469$(eval $(call declare-emitted-import-lib-dependency,chicken.bytevector,library))470$(eval $(call declare-emitted-import-lib-dependency,chicken.fixnum,library))471$(eval $(call declare-emitted-import-lib-dependency,chicken.flonum,library))472$(eval $(call declare-emitted-import-lib-dependency,chicken.gc,library))473$(eval $(call declare-emitted-import-lib-dependency,chicken.keyword,library))474$(eval $(call declare-emitted-import-lib-dependency,chicken.platform,library))475$(eval $(call declare-emitted-import-lib-dependency,chicken.plist,library))476$(eval $(call declare-emitted-import-lib-dependency,chicken.process-context,library))477$(eval $(call declare-emitted-import-lib-dependency,chicken.time,library))478$(eval $(call declare-emitted-import-lib-dependency,chicken.load,eval))479$(eval $(call declare-emitted-import-lib-dependency,chicken.format,extras))480$(eval $(call declare-emitted-import-lib-dependency,chicken.io,library))481$(eval $(call declare-emitted-import-lib-dependency,chicken.pretty-print,extras))482$(eval $(call declare-emitted-import-lib-dependency,chicken.version,extras))483$(eval $(call declare-emitted-import-lib-dependency,chicken.random,extras))484$(eval $(call declare-emitted-import-lib-dependency,chicken.locative,lolevel))485$(eval $(call declare-emitted-import-lib-dependency,chicken.memory,lolevel))486$(eval $(call declare-emitted-import-lib-dependency,chicken.memory.representation,lolevel))487$(eval $(call declare-emitted-import-lib-dependency,chicken.number-vector,srfi-4))488$(eval $(call declare-emitted-import-lib-dependency,chicken.sort,data-structures))489$(eval $(call declare-emitted-import-lib-dependency,chicken.string,data-structures))490$(eval $(call declare-emitted-import-lib-dependency,scheme.write,r7lib))491$(eval $(call declare-emitted-import-lib-dependency,scheme.time,r7lib))492$(eval $(call declare-emitted-import-lib-dependency,scheme.file,r7lib))493$(eval $(call declare-emitted-import-lib-dependency,scheme.process-context,r7lib))494495chicken.c: chicken.scm mini-srfi-1.scm \496 chicken.compiler.batch-driver.import.scm \497 chicken.compiler.c-platform.import.scm \498 chicken.compiler.support.import.scm \499 chicken.compiler.user-pass.import.scm \500 chicken.process-context.import.scm \501 chicken.string.import.scm502batch-driver.c: batch-driver.scm mini-srfi-1.scm \503 chicken.compiler.core.import.scm \504 chicken.compiler.compiler-syntax.import.scm \505 chicken.compiler.optimizer.import.scm \506 chicken.compiler.scrutinizer.import.scm \507 chicken.compiler.c-platform.import.scm \508 chicken.compiler.lfa2.import.scm \509 chicken.compiler.c-backend.import.scm \510 chicken.compiler.support.import.scm \511 chicken.compiler.user-pass.import.scm \512 chicken.format.import.scm \513 chicken.gc.import.scm \514 chicken.internal.import.scm \515 chicken.load.import.scm \516 chicken.pathname.import.scm \517 chicken.platform.import.scm \518 chicken.pretty-print.import.scm \519 chicken.process-context.import.scm \520 chicken.process-context.posix.import.scm \521 chicken.condition.import.scm \522 chicken.port.import.scm \523 chicken.string.import.scm \524 chicken.syntax.import.scm \525 chicken.time.import.scm526c-platform.c: c-platform.scm mini-srfi-1.scm \527 chicken.compiler.optimizer.import.scm \528 chicken.compiler.support.import.scm \529 chicken.compiler.core.import.scm \530 chicken.internal.import.scm531c-backend.c: c-backend.scm mini-srfi-1.scm \532 chicken.compiler.c-platform.import.scm \533 chicken.compiler.support.import.scm \534 chicken.compiler.core.import.scm \535 chicken.bitwise.import.scm \536 chicken.flonum.import.scm \537 chicken.foreign.import.scm \538 chicken.format.import.scm \539 chicken.internal.import.scm \540 chicken.sort.import.scm \541 chicken.string.import.scm \542 chicken.time.import.scm543core.c: core.scm mini-srfi-1.scm \544 chicken.compiler.scrutinizer.import.scm \545 chicken.compiler.support.import.scm \546 chicken.eval.import.scm \547 chicken.file.import.scm \548 chicken.fixnum.import.scm \549 chicken.format.import.scm \550 chicken.io.import.scm \551 chicken.keyword.import.scm \552 chicken.load.import.scm \553 chicken.pretty-print.import.scm \554 chicken.string.import.scm \555 chicken.syntax.import.scm556optimizer.c: optimizer.scm mini-srfi-1.scm \557 chicken.compiler.support.import.scm \558 chicken.fixnum.import.scm \559 chicken.internal.import.scm \560 chicken.sort.import.scm \561 chicken.string.import.scm562scheduler.c: scheduler.scm \563 chicken.fixnum.import.scm \564 chicken.format.import.scm \565 chicken.condition.import.scm566scrutinizer.c: scrutinizer.scm mini-srfi-1.scm \567 chicken.compiler.support.import.scm \568 chicken.fixnum.import.scm \569 chicken.format.import.scm \570 chicken.internal.import.scm \571 chicken.io.import.scm \572 chicken.pathname.import.scm \573 chicken.platform.import.scm \574 chicken.sort.import.scm \575 chicken.port.import.scm \576 chicken.pretty-print.import.scm \577 chicken.string.import.scm578lfa2.c: lfa2.scm mini-srfi-1.scm \579 chicken.compiler.support.import.scm \580 chicken.format.import.scm581compiler-syntax.c: compiler-syntax.scm mini-srfi-1.scm \582 chicken.compiler.support.import.scm \583 chicken.compiler.core.import.scm \584 chicken.fixnum.import.scm \585 chicken.format.import.scm \586 chicken.syntax.import.scm587chicken-ffi-syntax.c: chicken-ffi-syntax.scm \588 chicken.format.import.scm \589 chicken.internal.import.scm \590 chicken.string.import.scm591support.c: support.scm mini-srfi-1.scm \592 chicken.bitwise.import.scm \593 chicken.bytevector.import.scm \594 chicken.condition.import.scm \595 chicken.file.import.scm \596 chicken.fixnum.import.scm \597 chicken.foreign.import.scm \598 chicken.format.import.scm \599 chicken.internal.import.scm \600 chicken.io.import.scm \601 chicken.keyword.import.scm \602 chicken.pathname.import.scm \603 chicken.platform.import.scm \604 chicken.plist.import.scm \605 chicken.port.import.scm \606 chicken.pretty-print.import.scm \607 chicken.random.import.scm \608 chicken.sort.import.scm \609 chicken.string.import.scm \610 chicken.time.import.scm611modules.c: modules.scm \612 chicken.internal.import.scm \613 chicken.format.import.scm \614 chicken.keyword.import.scm \615 chicken.base.import.scm \616 chicken.syntax.import.scm \617 chicken.load.import.scm \618 chicken.platform.import.scm619csc.c: csc.scm \620 chicken.file.import.scm \621 chicken.foreign.import.scm \622 chicken.format.import.scm \623 chicken.io.import.scm \624 chicken.pathname.import.scm \625 chicken.process.import.scm \626 chicken.process-context.import.scm \627 chicken.string.import.scm628csi.c: csi.scm \629 chicken.condition.import.scm \630 chicken.file.import.scm \631 chicken.foreign.import.scm \632 chicken.format.import.scm \633 chicken.gc.import.scm \634 chicken.internal.import.scm \635 chicken.io.import.scm \636 chicken.keyword.import.scm \637 chicken.load.import.scm \638 chicken.platform.import.scm \639 chicken.port.import.scm \640 chicken.pretty-print.import.scm \641 chicken.process.import.scm \642 chicken.process-context.import.scm \643 chicken.repl.import.scm \644 chicken.sort.import.scm \645 chicken.string.import.scm \646 scheme.write.import.scm647chicken-profile.c: chicken-profile.scm \648 chicken.internal.import.scm \649 chicken.file.import.scm \650 chicken.file.posix.import.scm \651 chicken.fixnum.import.scm \652 chicken.process-context.import.scm \653 chicken.sort.import.scm \654 chicken.string.import.scm655chicken-status.c: chicken-status.scm \656 chicken.file.import.scm \657 chicken.file.posix.import.scm \658 chicken.fixnum.import.scm \659 chicken.foreign.import.scm \660 chicken.format.import.scm \661 chicken.irregex.import.scm \662 chicken.pathname.import.scm \663 chicken.port.import.scm \664 chicken.pretty-print.import.scm \665 chicken.process-context.import.scm \666 chicken.sort.import.scm \667 chicken.string.import.scm668chicken-install.c: chicken-install.scm \669 chicken.condition.import.scm \670 chicken.file.import.scm \671 chicken.file.posix.import.scm \672 chicken.fixnum.import.scm \673 chicken.foreign.import.scm \674 chicken.format.import.scm \675 chicken.internal.import.scm \676 chicken.io.import.scm \677 chicken.irregex.import.scm \678 chicken.pathname.import.scm \679 chicken.port.import.scm \680 chicken.pretty-print.import.scm \681 chicken.process.import.scm \682 chicken.process-context.import.scm \683 chicken.sort.import.scm \684 chicken.string.import.scm \685 chicken.version.import.scm \686 chicken.tcp.import.scm687chicken-uninstall.c: chicken-uninstall.scm \688 chicken.file.import.scm \689 chicken.fixnum.import.scm \690 chicken.foreign.import.scm \691 chicken.format.import.scm \692 chicken.irregex.import.scm \693 chicken.pathname.import.scm \694 chicken.port.import.scm \695 chicken.process.import.scm \696 chicken.process-context.import.scm \697 chicken.string.import.scm698chicken-syntax.c: chicken-syntax.scm \699 chicken.fixnum.import.scm \700 chicken.platform.import.scm \701 chicken.internal.import.scm702srfi-4.c: srfi-4.scm \703 chicken.bitwise.import.scm \704 chicken.bytevector.import.scm \705 chicken.fixnum.import.scm \706 chicken.foreign.import.scm \707 chicken.gc.import.scm \708 chicken.platform.import.scm709posixunix.c: posixunix.scm \710 chicken.bitwise.import.scm \711 chicken.condition.import.scm \712 chicken.foreign.import.scm \713 chicken.memory.import.scm \714 chicken.pathname.import.scm \715 chicken.platform.import.scm \716 chicken.port.import.scm \717 chicken.process-context.import.scm \718 chicken.time.import.scm719posixwin.c: posixwin.scm \720 chicken.condition.import.scm \721 chicken.bitwise.import.scm \722 chicken.foreign.import.scm \723 chicken.memory.import.scm \724 chicken.pathname.import.scm \725 chicken.platform.import.scm \726 chicken.port.import.scm \727 chicken.process-context.import.scm \728 chicken.string.import.scm \729 chicken.time.import.scm730data-structures.c: data-structures.scm \731 chicken.condition.import.scm \732 chicken.fixnum.import.scm \733 chicken.foreign.import.scm734expand.c: expand.scm \735 chicken.bytevector.import.scm \736 chicken.condition.import.scm \737 chicken.fixnum.import.scm \738 chicken.keyword.import.scm \739 chicken.platform.import.scm \740 chicken.string.import.scm \741 chicken.internal.import.scm742extras.c: extras.scm \743 chicken.fixnum.import.scm \744 chicken.string.import.scm \745 chicken.time.import.scm746eval.c: eval.scm \747 chicken.bytevector.import.scm \748 chicken.condition.import.scm \749 chicken.fixnum.import.scm \750 chicken.foreign.import.scm \751 chicken.internal.import.scm \752 chicken.keyword.import.scm \753 chicken.syntax.import.scm \754 chicken.platform.import.scm755repl.c: repl.scm \756 chicken.eval.import.scm757file.c: file.scm \758 chicken.condition.import.scm \759 chicken.fixnum.import.scm \760 chicken.io.import.scm \761 chicken.irregex.import.scm \762 chicken.foreign.import.scm \763 chicken.pathname.import.scm \764 chicken.process-context.import.scm765lolevel.c: lolevel.scm \766 chicken.fixnum.import.scm \767 chicken.foreign.import.scm768pathname.c: pathname.scm \769 chicken.fixnum.import.scm \770 chicken.irregex.import.scm \771 chicken.platform.import.scm \772 chicken.string.import.scm773port.c: port.scm \774 chicken.fixnum.import.scm \775 chicken.io.import.scm776read-syntax.c: read-syntax.scm \777 chicken.internal.import.scm \778 chicken.platform.import.scm779tcp.c: tcp.scm \780 chicken.fixnum.import.scm \781 chicken.foreign.import.scm \782 chicken.port.import.scm \783 chicken.time.import.scm784eval-modules.c: eval-modules.scm $(DYNAMIC_IMPORT_LIBRARIES:=.import.scm) \785 $(foreach lib,$(DYNAMIC_CHICKEN_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \786 $(foreach lib,$(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),$(lib).c)787continuation.c: continuation.scm \788 chicken.fixnum.import.scm789internal.c: internal.scm \790 chicken.fixnum.import.scm791irregex.c: irregex.scm \792 chicken.fixnum.import.scm \793 chicken.syntax.import.scm794profiler.c: profiler.scm \795 chicken.fixnum.import.scm796stub.c: stub.scm \797 chicken.platform.import.scm798r7lib.c: r7lib.scm \799 chicken.platform.import.scm \800 chicken.process-context.import.scm \801 chicken.time.import.scm \802 chicken.io.import.scm \803 chicken.file.import.scm804805define profile-flags806$(if $(filter $(basename $(1)),$(PROFILE_OBJECTS)),-profile)807endef808809bootstrap-lib = $(CHICKEN) $(call profile-flags, $@) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@810811library.c: $(SRCDIR)library.scm812 $(bootstrap-lib) \813 -no-module-registration \814 -emit-import-library chicken.bitwise \815 -emit-import-library chicken.bytevector \816 -emit-import-library chicken.fixnum \817 -emit-import-library chicken.flonum \818 -emit-import-library chicken.gc \819 -emit-import-library chicken.keyword \820 -emit-import-library chicken.platform \821 -emit-import-library chicken.plist \822 -emit-import-library chicken.io \823 -emit-import-library chicken.process-context824internal.c: $(SRCDIR)internal.scm $(SRCDIR)mini-srfi-1.scm825 $(bootstrap-lib) -emit-import-library chicken.internal826eval.c: $(SRCDIR)eval.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm827 $(bootstrap-lib) \828 -emit-import-library chicken.eval \829 -emit-import-library chicken.load830r7lib.c: $(SRCDIR)r7lib.scm $(SRCDIR)common-declarations.scm831 $(bootstrap-lib) -emit-import-library scheme.write \832 -emit-import-library scheme.time \833 -emit-import-library scheme.file \834 -emit-import-library scheme.process-context835read-syntax.c: $(SRCDIR)read-syntax.scm $(SRCDIR)common-declarations.scm836 $(bootstrap-lib) -emit-import-library chicken.read-syntax837repl.c: $(SRCDIR)repl.scm $(SRCDIR)common-declarations.scm838 $(bootstrap-lib) -emit-import-library chicken.repl839expand.c: $(SRCDIR)expand.scm $(SRCDIR)synrules.scm $(SRCDIR)common-declarations.scm840 $(bootstrap-lib) \841 -no-module-registration842modules.c: $(SRCDIR)modules.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm843 $(bootstrap-lib)844extras.c: $(SRCDIR)extras.scm $(SRCDIR)common-declarations.scm845 $(bootstrap-lib) \846 -emit-import-library chicken.format \847 -emit-import-library chicken.pretty-print \848 -emit-import-library chicken.random \849 -emit-import-library chicken.version850posixunix.c: $(SRCDIR)posix.scm $(SRCDIR)posixunix.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm851 $(bootstrap-lib) -feature platform-unix \852 -emit-import-library chicken.errno \853 -emit-import-library chicken.file.posix \854 -emit-import-library chicken.time.posix \855 -emit-import-library chicken.process \856 -emit-import-library chicken.process.signal \857 -emit-import-library chicken.process-context.posix \858 -no-module-registration859posixwin.c: $(SRCDIR)posix.scm $(SRCDIR)posixwin.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm860 $(bootstrap-lib) -feature platform-windows \861 -emit-import-library chicken.errno \862 -emit-import-library chicken.file.posix \863 -emit-import-library chicken.time.posix \864 -emit-import-library chicken.process \865 -emit-import-library chicken.process.signal \866 -emit-import-library chicken.process-context.posix \867 -no-module-registration868irregex.c: $(SRCDIR)irregex.scm $(SRCDIR)irregex-core.scm $(SRCDIR)irregex-utils.scm $(SRCDIR)common-declarations.scm869 $(bootstrap-lib) -emit-import-library chicken.irregex870chicken-syntax.c: $(SRCDIR)chicken-syntax.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm871 $(bootstrap-lib)872chicken-ffi-syntax.c: $(SRCDIR)chicken-ffi-syntax.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm873 $(bootstrap-lib)874continuation.c: $(SRCDIR)continuation.scm $(SRCDIR)common-declarations.scm875 $(bootstrap-lib) -emit-import-library chicken.continuation876data-structures.c: $(SRCDIR)data-structures.scm $(SRCDIR)common-declarations.scm877 $(bootstrap-lib) \878 -emit-import-library chicken.sort \879 -emit-import-library chicken.string880pathname.c: $(SRCDIR)pathname.scm $(SRCDIR)common-declarations.scm881 $(bootstrap-lib) -emit-import-library chicken.pathname882port.c: $(SRCDIR)port.scm $(SRCDIR)common-declarations.scm883 $(bootstrap-lib) -emit-import-library chicken.port884file.c: $(SRCDIR)file.scm $(SRCDIR)common-declarations.scm885 $(bootstrap-lib) -emit-import-library chicken.file886lolevel.c: $(SRCDIR)lolevel.scm $(SRCDIR)common-declarations.scm887 $(bootstrap-lib) \888 -emit-import-library chicken.locative \889 -emit-import-library chicken.memory \890 -emit-import-library chicken.memory.representation891tcp.c: $(SRCDIR)tcp.scm $(SRCDIR)common-declarations.scm892 $(bootstrap-lib) -emit-import-library chicken.tcp893srfi-4.c: $(SRCDIR)srfi-4.scm $(SRCDIR)common-declarations.scm894 $(bootstrap-lib) -emit-import-library srfi-4 \895 -emit-import-library chicken.number-vector896scheduler.c: $(SRCDIR)scheduler.scm $(SRCDIR)common-declarations.scm897 $(bootstrap-lib)898profiler.c: $(SRCDIR)profiler.scm $(SRCDIR)common-declarations.scm899 $(bootstrap-lib)900stub.c: $(SRCDIR)stub.scm $(SRCDIR)common-declarations.scm901 $(bootstrap-lib)902debugger-client.c: $(SRCDIR)debugger-client.scm $(SRCDIR)common-declarations.scm dbg-stub.c903 $(bootstrap-lib)904build-version.c: $(SRCDIR)build-version.scm $(SRCDIR)buildversion buildbranch buildid905 $(bootstrap-lib)906eval-modules.c: $(SRCDIR)eval-modules.scm $(SRCDIR)common-declarations.scm907 $(bootstrap-lib)908909define declare-bootstrap-import-lib910$(1).import.c: $$(SRCDIR)$(1).import.scm911 $$(CHICKEN) $$< $$(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $$@912endef913914$(foreach obj, $(IMPORT_LIBRARIES),\915 $(eval $(call declare-bootstrap-import-lib,$(obj))))916917# Bootstrap compiler objects918919define declare-bootstrap-compiler-object920$(1).c: $$(SRCDIR)$(1).scm $$(SRCDIR)tweaks.scm921 $$(CHICKEN) $$< $$(CHICKEN_PROGRAM_OPTIONS) -emit-import-library chicken.compiler.$(1) \922 -output-file $$@923endef924925$(foreach obj, $(COMPILER_OBJECTS_1),\926 $(eval $(call declare-bootstrap-compiler-object,$(obj))))927928csi.c: $(SRCDIR)csi.scm $(SRCDIR)banner.scm $(SRCDIR)mini-srfi-1.scm929 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@930chicken-profile.c: $(SRCDIR)chicken-profile.scm $(SRCDIR)mini-srfi-1.scm931 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@932chicken-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.scm933 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@934chicken-uninstall.c: $(SRCDIR)chicken-uninstall.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm $(SRCDIR)egg-information.scm935 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@936chicken-status.c: $(SRCDIR)chicken-status.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm $(SRCDIR)egg-information.scm937 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@938csc.c: $(SRCDIR)csc.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm939 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@940941# distribution files942943.PHONY: distfiles dist html944945distfiles: $(DISTFILES)946947dist: distfiles html948 echo '# this file is intentionally empty' > config.make949 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 $(LIBCHICKEN_SO_FILE) \974 $(PRIMARY_LIBCHICKEN) \975 lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) \976 $(IMPORT_LIBRARIES:=.import.so) $(LIBCHICKEN_IMPORT_LIBRARY) \977 $(foreach lib,$(DYNAMIC_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \978 $(BUILD_CONFIG_FILES)979ifdef USES_SONAME980 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX).so.$(BINARYVERSION)981endif982983confclean:984 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(BUILD_CONFIG_FILES)985 touch config.make986987spotless: 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)1020 cd tests; sh runtests.sh10211022# benchmark10231024.PHONY: bench10251026bench: $(CHICKEN_SHARED_EXECUTABLE) $(CSI_SHARED_EXECUTABLE) $(CSC_PROGRAM)$(EXE)1027 cd tests; echo >>bench.log; date >>bench.log; sh runbench.sh 2>&1 | tee -a bench.log102810291030# build static bootstrapping chicken10311032.PHONY: boot-chicken bootclean10331034STAGE1_CONFIG = PLATFORM=$(PLATFORM) PREFIX=/nowhere CONFIG= \1035 CHICKEN=$(CHICKEN) PROGRAM_SUFFIX=-boot-stage1 STATICBUILD=1 \1036 C_COMPILER_OPTIMIZATION_OPTIONS="$(C_COMPILER_OPTIMIZATION_OPTIONS)" BUILDING_CHICKEN_BOOT=110371038BOOT_CONFIG = PLATFORM=$(PLATFORM) PREFIX=/nowhere CONFIG= \1039 CHICKEN=.$(SEP)chicken-boot-stage1$(EXE) PROGRAM_SUFFIX=-boot \1040 STATICBUILD=1 C_COMPILER_OPTIMIZATION_OPTIONS="$(C_COMPILER_OPTIMIZATION_OPTIONS)"10411042boot-chicken:1043 "$(MAKE)" $(STAGE1_CONFIG) confclean1044 "$(MAKE)" $(STAGE1_CONFIG) chicken-boot-stage1$(EXE)1045 "$(MAKE)" $(BOOT_CONFIG) touchfiles1046 "$(MAKE)" $(BOOT_CONFIG) chicken-boot$(EXE)1047 "$(MAKE)" $(BOOT_CONFIG) confclean10481049bootclean:1050 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) \1051 $(SRCDIR)chicken-boot$(EXE) \1052 $(SRCDIR)chicken-boot-stage1$(EXE) \1053 $(SRCDIR)libchicken-boot$(A) \1054 $(SRCDIR)libchicken-boot-stage1$(A)10551056.PHONY: touchfiles10571058touchfiles:1059ifdef WINDOWS_SHELL1060 for %%x in (*.scm) do copy /b %%x +,,1061else1062 touch *.scm1063endif