~ 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-db364 $(MAKE_READABLE_COMMAND) "$(DESTDIR)$(IEGGDIR)$(SEP)modules.db"365else366 @echo367 @echo "Warning: cannot run \`$(CHICKEN_INSTALL_PROGRAM) -update-db' when cross-compiling or DESTDIR is set"368 @echo369endif370endif371ifdef WINDOWS_SHELL372 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(SRCDIR)csibatch.bat "$(DESTDIR)$(IBINDIR)"373endif374375install-other-files:376 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)"377 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDOCDIR)"378 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDATADIR)"379380 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROGRAM).1"381 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csc$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSC_PROGRAM).1"382 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csi$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSI_PROGRAM).1"383 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-do$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DO_PROGRAM).1"384 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-install$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM).1"385 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-uninstall$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM).1"386 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-status$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_STATUS_PROGRAM).1"387 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-profile$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM).1"388 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)feathers$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DEBUGGER_PROGRAM).1"389390 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDOCDIR)$(SEP)manual"391 -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)manual-html$(SEP)* "$(DESTDIR)$(IDOCDIR)$(SEP)manual"392 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)README "$(DESTDIR)$(IDOCDIR)"393 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)DEPRECATED "$(DESTDIR)$(IDOCDIR)"394 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)LICENSE "$(DESTDIR)$(IDOCDIR)"395 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)setup.defaults "$(DESTDIR)$(IDATADIR)"396 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)feathers.tcl "$(DESTDIR)$(IDATADIR)"397398install-wrappers:399ifeq ($(WRAPPERDIR),)400 @echo401 @echo Error: WRAPPERDIR is not set402 @echo403 @exit 1404endif405 $(foreach prg, $(INSTALLED_PROGRAMS), \406 $(CSI) -s $(SRCDIR)scripts$(SEP)make-wrapper.scm $(prg) "$(WRAPPERDIR)" $(NL))407408uninstall:409 $(foreach prog,$(INSTALLED_PROGRAMS),\410 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS)\411 "$(DESTDIR)$(IBINDIR)$(SEP)$(prog)$(EXE)" $(NL))412 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_DEBUGGER_PROGRAM)"413 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A)"414 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)"415ifdef USES_SONAME416 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO).$(BINARYVERSION)"417endif418ifdef WINDOWS419 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)"420 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_IMPORT_LIBRARY)"421endif422ifeq ($(PLATFORM),cygwin)423 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)cyg$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)*"424endif425426 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROGRAM).1"427 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSC_PROGRAM).1"428 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSI_PROGRAM).1"429 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DO_PROGRAM).1"430 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM).1"431 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM).1"432 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_STATUS_PROGRAM).1"433 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM).1"434 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DEBUGGER_PROGRAM).1"435436 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)$(SEP)chicken.h"437 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)$(SEP)$(CHICKEN_CONFIG_H)"438 $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) "$(DESTDIR)$(IDATADIR)"439 $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) "$(DESTDIR)$(IEGGDIR)"440ifdef WINDOWS_SHELL441 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)csibatch.bat"442endif443444# build versioning445446ifdef WINDOWS_SHELL447buildbranch:448 echo.$(BRANCHNAME)>buildbranch449buildid:450 echo.$(BUILD_ID)>buildid451else452.PHONY: identify-me453454identify-me:455 @sh $(SRCDIR)identify.sh $(SRCDIR)456457buildbranch: identify-me458buildid: identify-me459endif460461# bootstrapping c sources462463define declare-emitted-import-lib-dependency464.SECONDARY: $(1).import.scm465$(1).import.scm: $(2).c466endef467468define declare-emitted-chicken-import-lib-dependency469$(call declare-emitted-import-lib-dependency,chicken.$(1),$(1))470endef471472define declare-emitted-compiler-import-lib-dependency473$(call declare-emitted-import-lib-dependency,chicken.compiler.$(1),$(1))474endef475476$(foreach lib, $(DYNAMIC_IMPORT_LIBRARIES),\477 $(eval $(call declare-emitted-import-lib-dependency,$(lib),$(lib))))478479$(foreach lib, $(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),\480 $(eval $(call declare-emitted-chicken-import-lib-dependency,$(lib))))481482$(foreach lib, $(COMPILER_OBJECTS_1),\483 $(eval $(call declare-emitted-compiler-import-lib-dependency,$(lib))))484485# special cases for modules not corresponding directly to units486$(eval $(call declare-emitted-import-lib-dependency,chicken.errno,$(POSIXFILE)))487$(eval $(call declare-emitted-import-lib-dependency,chicken.file.posix,$(POSIXFILE)))488$(eval $(call declare-emitted-import-lib-dependency,chicken.time.posix,$(POSIXFILE)))489$(eval $(call declare-emitted-import-lib-dependency,chicken.process,$(POSIXFILE)))490$(eval $(call declare-emitted-import-lib-dependency,chicken.process.signal,$(POSIXFILE)))491$(eval $(call declare-emitted-import-lib-dependency,chicken.process-context.posix,$(POSIXFILE)))492$(eval $(call declare-emitted-import-lib-dependency,chicken.bitwise,library))493$(eval $(call declare-emitted-import-lib-dependency,chicken.blob,library))494$(eval $(call declare-emitted-import-lib-dependency,chicken.fixnum,library))495$(eval $(call declare-emitted-import-lib-dependency,chicken.flonum,library))496$(eval $(call declare-emitted-import-lib-dependency,chicken.gc,library))497$(eval $(call declare-emitted-import-lib-dependency,chicken.keyword,library))498$(eval $(call declare-emitted-import-lib-dependency,chicken.platform,library))499$(eval $(call declare-emitted-import-lib-dependency,chicken.plist,library))500$(eval $(call declare-emitted-import-lib-dependency,chicken.process-context,library))501$(eval $(call declare-emitted-import-lib-dependency,chicken.time,library))502$(eval $(call declare-emitted-import-lib-dependency,chicken.load,eval))503$(eval $(call declare-emitted-import-lib-dependency,chicken.format,extras))504$(eval $(call declare-emitted-import-lib-dependency,chicken.io,extras))505$(eval $(call declare-emitted-import-lib-dependency,chicken.pretty-print,extras))506$(eval $(call declare-emitted-import-lib-dependency,chicken.random,extras))507$(eval $(call declare-emitted-import-lib-dependency,chicken.locative,lolevel))508$(eval $(call declare-emitted-import-lib-dependency,chicken.memory,lolevel))509$(eval $(call declare-emitted-import-lib-dependency,chicken.memory.representation,lolevel))510$(eval $(call declare-emitted-import-lib-dependency,chicken.sort,data-structures))511$(eval $(call declare-emitted-import-lib-dependency,chicken.string,data-structures))512513chicken.c: chicken.scm mini-srfi-1.scm \514 chicken.compiler.batch-driver.import.scm \515 chicken.compiler.c-platform.import.scm \516 chicken.compiler.support.import.scm \517 chicken.compiler.user-pass.import.scm \518 chicken.process-context.import.scm \519 chicken.string.import.scm520batch-driver.c: batch-driver.scm mini-srfi-1.scm \521 chicken.compiler.core.import.scm \522 chicken.compiler.compiler-syntax.import.scm \523 chicken.compiler.optimizer.import.scm \524 chicken.compiler.scrutinizer.import.scm \525 chicken.compiler.c-platform.import.scm \526 chicken.compiler.lfa2.import.scm \527 chicken.compiler.c-backend.import.scm \528 chicken.compiler.support.import.scm \529 chicken.compiler.user-pass.import.scm \530 chicken.format.import.scm \531 chicken.gc.import.scm \532 chicken.internal.import.scm \533 chicken.load.import.scm \534 chicken.pathname.import.scm \535 chicken.platform.import.scm \536 chicken.pretty-print.import.scm \537 chicken.process-context.import.scm \538 chicken.process-context.posix.import.scm \539 chicken.condition.import.scm \540 chicken.port.import.scm \541 chicken.string.import.scm \542 chicken.syntax.import.scm \543 chicken.time.import.scm544c-platform.c: c-platform.scm mini-srfi-1.scm \545 chicken.compiler.optimizer.import.scm \546 chicken.compiler.support.import.scm \547 chicken.compiler.core.import.scm \548 chicken.internal.import.scm549c-backend.c: c-backend.scm mini-srfi-1.scm \550 chicken.compiler.c-platform.import.scm \551 chicken.compiler.support.import.scm \552 chicken.compiler.core.import.scm \553 chicken.bitwise.import.scm \554 chicken.flonum.import.scm \555 chicken.foreign.import.scm \556 chicken.format.import.scm \557 chicken.internal.import.scm \558 chicken.sort.import.scm \559 chicken.string.import.scm \560 chicken.time.import.scm561core.c: core.scm mini-srfi-1.scm \562 chicken.compiler.scrutinizer.import.scm \563 chicken.compiler.support.import.scm \564 chicken.eval.import.scm \565 chicken.file.import.scm \566 chicken.fixnum.import.scm \567 chicken.format.import.scm \568 chicken.io.import.scm \569 chicken.keyword.import.scm \570 chicken.load.import.scm \571 chicken.pretty-print.import.scm \572 chicken.string.import.scm \573 chicken.syntax.import.scm574optimizer.c: optimizer.scm mini-srfi-1.scm \575 chicken.compiler.support.import.scm \576 chicken.fixnum.import.scm \577 chicken.internal.import.scm \578 chicken.sort.import.scm \579 chicken.string.import.scm580scheduler.c: scheduler.scm \581 chicken.fixnum.import.scm \582 chicken.format.import.scm \583 chicken.condition.import.scm584scrutinizer.c: scrutinizer.scm mini-srfi-1.scm \585 chicken.compiler.support.import.scm \586 chicken.fixnum.import.scm \587 chicken.format.import.scm \588 chicken.internal.import.scm \589 chicken.io.import.scm \590 chicken.pathname.import.scm \591 chicken.platform.import.scm \592 chicken.sort.import.scm \593 chicken.port.import.scm \594 chicken.pretty-print.import.scm \595 chicken.string.import.scm596lfa2.c: lfa2.scm mini-srfi-1.scm \597 chicken.compiler.support.import.scm \598 chicken.format.import.scm599compiler-syntax.c: compiler-syntax.scm mini-srfi-1.scm \600 chicken.compiler.support.import.scm \601 chicken.compiler.core.import.scm \602 chicken.fixnum.import.scm \603 chicken.format.import.scm \604 chicken.syntax.import.scm605chicken-ffi-syntax.c: chicken-ffi-syntax.scm \606 chicken.format.import.scm \607 chicken.internal.import.scm \608 chicken.string.import.scm609support.c: support.scm mini-srfi-1.scm \610 chicken.bitwise.import.scm \611 chicken.blob.import.scm \612 chicken.condition.import.scm \613 chicken.file.import.scm \614 chicken.fixnum.import.scm \615 chicken.foreign.import.scm \616 chicken.format.import.scm \617 chicken.internal.import.scm \618 chicken.io.import.scm \619 chicken.keyword.import.scm \620 chicken.pathname.import.scm \621 chicken.platform.import.scm \622 chicken.plist.import.scm \623 chicken.port.import.scm \624 chicken.pretty-print.import.scm \625 chicken.random.import.scm \626 chicken.sort.import.scm \627 chicken.string.import.scm \628 chicken.time.import.scm629modules.c: modules.scm \630 chicken.internal.import.scm \631 chicken.keyword.import.scm \632 chicken.base.import.scm \633 chicken.syntax.import.scm \634 chicken.load.import.scm \635 chicken.platform.import.scm636csc.c: csc.scm \637 chicken.file.import.scm \638 chicken.foreign.import.scm \639 chicken.format.import.scm \640 chicken.io.import.scm \641 chicken.pathname.import.scm \642 chicken.process.import.scm \643 chicken.process-context.import.scm \644 chicken.string.import.scm645csi.c: csi.scm \646 chicken.condition.import.scm \647 chicken.file.import.scm \648 chicken.foreign.import.scm \649 chicken.format.import.scm \650 chicken.gc.import.scm \651 chicken.internal.import.scm \652 chicken.io.import.scm \653 chicken.keyword.import.scm \654 chicken.load.import.scm \655 chicken.platform.import.scm \656 chicken.port.import.scm \657 chicken.pretty-print.import.scm \658 chicken.process.import.scm \659 chicken.process-context.import.scm \660 chicken.repl.import.scm \661 chicken.sort.import.scm \662 chicken.string.import.scm663chicken-profile.c: chicken-profile.scm \664 chicken.internal.import.scm \665 chicken.file.import.scm \666 chicken.file.posix.import.scm \667 chicken.fixnum.import.scm \668 chicken.process-context.import.scm \669 chicken.sort.import.scm \670 chicken.string.import.scm671chicken-status.c: chicken-status.scm \672 chicken.file.import.scm \673 chicken.file.posix.import.scm \674 chicken.fixnum.import.scm \675 chicken.foreign.import.scm \676 chicken.format.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-context.import.scm \682 chicken.sort.import.scm \683 chicken.string.import.scm684chicken-install.c: chicken-install.scm \685 chicken.condition.import.scm \686 chicken.file.import.scm \687 chicken.file.posix.import.scm \688 chicken.fixnum.import.scm \689 chicken.foreign.import.scm \690 chicken.format.import.scm \691 chicken.internal.import.scm \692 chicken.io.import.scm \693 chicken.irregex.import.scm \694 chicken.pathname.import.scm \695 chicken.port.import.scm \696 chicken.pretty-print.import.scm \697 chicken.process.import.scm \698 chicken.process-context.import.scm \699 chicken.sort.import.scm \700 chicken.string.import.scm \701 chicken.tcp.import.scm702chicken-uninstall.c: chicken-uninstall.scm \703 chicken.file.import.scm \704 chicken.fixnum.import.scm \705 chicken.foreign.import.scm \706 chicken.format.import.scm \707 chicken.irregex.import.scm \708 chicken.pathname.import.scm \709 chicken.port.import.scm \710 chicken.process.import.scm \711 chicken.process-context.import.scm \712 chicken.string.import.scm713chicken-syntax.c: chicken-syntax.scm \714 chicken.fixnum.import.scm \715 chicken.platform.import.scm \716 chicken.internal.import.scm717srfi-4.c: srfi-4.scm \718 chicken.bitwise.import.scm \719 chicken.fixnum.import.scm \720 chicken.foreign.import.scm \721 chicken.gc.import.scm \722 chicken.platform.import.scm723posixunix.c: posixunix.scm \724 chicken.bitwise.import.scm \725 chicken.condition.import.scm \726 chicken.foreign.import.scm \727 chicken.memory.import.scm \728 chicken.pathname.import.scm \729 chicken.platform.import.scm \730 chicken.port.import.scm \731 chicken.process-context.import.scm \732 chicken.time.import.scm733posixwin.c: posixwin.scm \734 chicken.condition.import.scm \735 chicken.bitwise.import.scm \736 chicken.foreign.import.scm \737 chicken.memory.import.scm \738 chicken.pathname.import.scm \739 chicken.platform.import.scm \740 chicken.port.import.scm \741 chicken.process-context.import.scm \742 chicken.string.import.scm \743 chicken.time.import.scm744data-structures.c: data-structures.scm \745 chicken.condition.import.scm \746 chicken.fixnum.import.scm \747 chicken.foreign.import.scm748expand.c: expand.scm \749 chicken.blob.import.scm \750 chicken.condition.import.scm \751 chicken.fixnum.import.scm \752 chicken.keyword.import.scm \753 chicken.platform.import.scm \754 chicken.string.import.scm \755 chicken.internal.import.scm756extras.c: extras.scm \757 chicken.fixnum.import.scm \758 chicken.string.import.scm \759 chicken.time.import.scm760eval.c: eval.scm \761 chicken.blob.import.scm \762 chicken.condition.import.scm \763 chicken.fixnum.import.scm \764 chicken.foreign.import.scm \765 chicken.internal.import.scm \766 chicken.keyword.import.scm \767 chicken.syntax.import.scm \768 chicken.platform.import.scm769repl.c: repl.scm \770 chicken.eval.import.scm771file.c: file.scm \772 chicken.condition.import.scm \773 chicken.fixnum.import.scm \774 chicken.io.import.scm \775 chicken.irregex.import.scm \776 chicken.foreign.import.scm \777 chicken.pathname.import.scm \778 chicken.process-context.import.scm779lolevel.c: lolevel.scm \780 chicken.fixnum.import.scm \781 chicken.foreign.import.scm782pathname.c: pathname.scm \783 chicken.fixnum.import.scm \784 chicken.irregex.import.scm \785 chicken.platform.import.scm \786 chicken.string.import.scm787port.c: port.scm \788 chicken.fixnum.import.scm \789 chicken.io.import.scm790read-syntax.c: read-syntax.scm \791 chicken.internal.import.scm \792 chicken.platform.import.scm793tcp.c: tcp.scm \794 chicken.fixnum.import.scm \795 chicken.foreign.import.scm \796 chicken.port.import.scm \797 chicken.time.import.scm798eval-modules.c: eval-modules.scm $(DYNAMIC_IMPORT_LIBRARIES:=.import.scm) \799 $(foreach lib,$(DYNAMIC_CHICKEN_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \800 $(foreach lib,$(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),$(lib).c)801continuation.c: continuation.scm \802 chicken.fixnum.import.scm803internal.c: internal.scm \804 chicken.fixnum.import.scm805irregex.c: irregex.scm \806 chicken.fixnum.import.scm \807 chicken.syntax.import.scm808profiler.c: profiler.scm \809 chicken.fixnum.import.scm810stub.c: stub.scm \811 chicken.platform.import.scm812813814define profile-flags815$(if $(filter $(basename $(1)),$(PROFILE_OBJECTS)),-profile)816endef817818bootstrap-lib = $(CHICKEN) $(call profile-flags, $@) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@819820library.c: $(SRCDIR)library.scm821 $(bootstrap-lib) \822 -no-module-registration \823 -emit-import-library chicken.bitwise \824 -emit-import-library chicken.blob \825 -emit-import-library chicken.fixnum \826 -emit-import-library chicken.flonum \827 -emit-import-library chicken.gc \828 -emit-import-library chicken.keyword \829 -emit-import-library chicken.platform \830 -emit-import-library chicken.plist \831 -emit-import-library chicken.process-context832internal.c: $(SRCDIR)internal.scm $(SRCDIR)mini-srfi-1.scm833 $(bootstrap-lib) -emit-import-library chicken.internal834eval.c: $(SRCDIR)eval.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm835 $(bootstrap-lib) \836 -emit-import-library chicken.eval \837 -emit-import-library chicken.load838read-syntax.c: $(SRCDIR)read-syntax.scm $(SRCDIR)common-declarations.scm839 $(bootstrap-lib) -emit-import-library chicken.read-syntax840repl.c: $(SRCDIR)repl.scm $(SRCDIR)common-declarations.scm841 $(bootstrap-lib) -emit-import-library chicken.repl842expand.c: $(SRCDIR)expand.scm $(SRCDIR)synrules.scm $(SRCDIR)common-declarations.scm843 $(bootstrap-lib) \844 -no-module-registration845modules.c: $(SRCDIR)modules.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm846 $(bootstrap-lib)847extras.c: $(SRCDIR)extras.scm $(SRCDIR)common-declarations.scm848 $(bootstrap-lib) \849 -emit-import-library chicken.format \850 -emit-import-library chicken.io \851 -emit-import-library chicken.pretty-print \852 -emit-import-library chicken.random853posixunix.c: $(SRCDIR)posix.scm $(SRCDIR)posixunix.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm854 $(bootstrap-lib) -feature platform-unix \855 -emit-import-library chicken.errno \856 -emit-import-library chicken.file.posix \857 -emit-import-library chicken.time.posix \858 -emit-import-library chicken.process \859 -emit-import-library chicken.process.signal \860 -emit-import-library chicken.process-context.posix \861 -no-module-registration862posixwin.c: $(SRCDIR)posix.scm $(SRCDIR)posixwin.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm863 $(bootstrap-lib) -feature platform-windows \864 -emit-import-library chicken.errno \865 -emit-import-library chicken.file.posix \866 -emit-import-library chicken.time.posix \867 -emit-import-library chicken.process \868 -emit-import-library chicken.process.signal \869 -emit-import-library chicken.process-context.posix \870 -no-module-registration871irregex.c: $(SRCDIR)irregex.scm $(SRCDIR)irregex-core.scm $(SRCDIR)irregex-utils.scm $(SRCDIR)common-declarations.scm872 $(bootstrap-lib) -emit-import-library chicken.irregex873chicken-syntax.c: $(SRCDIR)chicken-syntax.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm874 $(bootstrap-lib)875chicken-ffi-syntax.c: $(SRCDIR)chicken-ffi-syntax.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm876 $(bootstrap-lib)877continuation.c: $(SRCDIR)continuation.scm $(SRCDIR)common-declarations.scm878 $(bootstrap-lib) -emit-import-library chicken.continuation879data-structures.c: $(SRCDIR)data-structures.scm $(SRCDIR)common-declarations.scm880 $(bootstrap-lib) \881 -emit-import-library chicken.sort \882 -emit-import-library chicken.string883pathname.c: $(SRCDIR)pathname.scm $(SRCDIR)common-declarations.scm884 $(bootstrap-lib) -emit-import-library chicken.pathname885port.c: $(SRCDIR)port.scm $(SRCDIR)common-declarations.scm886 $(bootstrap-lib) -emit-import-library chicken.port887file.c: $(SRCDIR)file.scm $(SRCDIR)common-declarations.scm888 $(bootstrap-lib) -emit-import-library chicken.file889lolevel.c: $(SRCDIR)lolevel.scm $(SRCDIR)common-declarations.scm890 $(bootstrap-lib) \891 -emit-import-library chicken.locative \892 -emit-import-library chicken.memory \893 -emit-import-library chicken.memory.representation894tcp.c: $(SRCDIR)tcp.scm $(SRCDIR)common-declarations.scm895 $(bootstrap-lib) -emit-import-library chicken.tcp896srfi-4.c: $(SRCDIR)srfi-4.scm $(SRCDIR)common-declarations.scm897 $(bootstrap-lib) -emit-import-library srfi-4898scheduler.c: $(SRCDIR)scheduler.scm $(SRCDIR)common-declarations.scm899 $(bootstrap-lib)900profiler.c: $(SRCDIR)profiler.scm $(SRCDIR)common-declarations.scm901 $(bootstrap-lib)902stub.c: $(SRCDIR)stub.scm $(SRCDIR)common-declarations.scm903 $(bootstrap-lib)904debugger-client.c: $(SRCDIR)debugger-client.scm $(SRCDIR)common-declarations.scm dbg-stub.c905 $(bootstrap-lib)906build-version.c: $(SRCDIR)build-version.scm $(SRCDIR)buildversion buildbranch buildid907 $(bootstrap-lib)908eval-modules.c: $(SRCDIR)eval-modules.scm $(SRCDIR)common-declarations.scm909 $(bootstrap-lib)910911define declare-bootstrap-import-lib912$(1).import.c: $$(SRCDIR)$(1).import.scm913 $$(CHICKEN) $$< $$(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $$@914endef915916$(foreach obj, $(IMPORT_LIBRARIES),\917 $(eval $(call declare-bootstrap-import-lib,$(obj))))918919# Bootstrap compiler objects920921define declare-bootstrap-compiler-object922$(1).c: $$(SRCDIR)$(1).scm $$(SRCDIR)tweaks.scm923 $$(CHICKEN) $$< $$(CHICKEN_PROGRAM_OPTIONS) -emit-import-library chicken.compiler.$(1) \924 -output-file $$@925endef926927$(foreach obj, $(COMPILER_OBJECTS_1),\928 $(eval $(call declare-bootstrap-compiler-object,$(obj))))929930csi.c: $(SRCDIR)csi.scm $(SRCDIR)banner.scm $(SRCDIR)mini-srfi-1.scm931 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@932chicken-profile.c: $(SRCDIR)chicken-profile.scm $(SRCDIR)mini-srfi-1.scm933 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@934chicken-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.scm935 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@936chicken-uninstall.c: $(SRCDIR)chicken-uninstall.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm $(SRCDIR)egg-information.scm937 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@938chicken-status.c: $(SRCDIR)chicken-status.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm $(SRCDIR)egg-information.scm939 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@940csc.c: $(SRCDIR)csc.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm941 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@942943# distribution files944945.PHONY: distfiles dist html946947distfiles: $(DISTFILES)948949dist: distfiles html950 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 $(CHICKEN_DEBUGGER_PROGRAM) \975 $(LIBCHICKEN_SO_FILE) \976 $(PRIMARY_LIBCHICKEN) \977 lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(A) \978 $(IMPORT_LIBRARIES:=.import.so) $(LIBCHICKEN_IMPORT_LIBRARY) \979 $(foreach lib,$(DYNAMIC_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \980 $(BUILD_CONFIG_FILES)981ifdef USES_SONAME982 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX).so.$(BINARYVERSION)983endif984985confclean:986 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(BUILD_CONFIG_FILES)987988spotless: 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)1021ifndef WINDOWS_SHELL1022 cd tests; sh runtests.sh1023else1024 cd tests & runtests.bat1025endif10261027# benchmark10281029.PHONY: bench10301031bench: $(CHICKEN_SHARED_EXECUTABLE) $(CSI_SHARED_EXECUTABLE) $(CSC_PROGRAM)$(EXE)1032 cd tests; echo >>bench.log; date >>bench.log; sh runbench.sh 2>&1 | tee -a bench.log103310341035# build static bootstrapping chicken10361037.PHONY: boot-chicken bootclean10381039STAGE1_CONFIG = PLATFORM=$(PLATFORM) PREFIX=/nowhere CONFIG= \1040 CHICKEN=$(CHICKEN) PROGRAM_SUFFIX=-boot-stage1 STATICBUILD=1 \1041 C_COMPILER_OPTIMIZATION_OPTIONS="$(C_COMPILER_OPTIMIZATION_OPTIONS)" BUILDING_CHICKEN_BOOT=110421043BOOT_CONFIG = PLATFORM=$(PLATFORM) PREFIX=/nowhere CONFIG= \1044 CHICKEN=.$(SEP)chicken-boot-stage1$(EXE) PROGRAM_SUFFIX=-boot \1045 STATICBUILD=1 C_COMPILER_OPTIMIZATION_OPTIONS="$(C_COMPILER_OPTIMIZATION_OPTIONS)"10461047boot-chicken:1048 "$(MAKE)" $(STAGE1_CONFIG) confclean1049 "$(MAKE)" $(STAGE1_CONFIG) chicken-boot-stage1$(EXE)1050 "$(MAKE)" $(BOOT_CONFIG) touchfiles1051 "$(MAKE)" $(BOOT_CONFIG) chicken-boot$(EXE)1052 "$(MAKE)" $(BOOT_CONFIG) confclean10531054bootclean:1055 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) \1056 $(SRCDIR)chicken-boot$(EXE) \1057 $(SRCDIR)chicken-boot-stage1$(EXE) \1058 $(SRCDIR)libchicken-boot$(A) \1059 $(SRCDIR)libchicken-boot-stage1$(A)10601061.PHONY: touchfiles10621063touchfiles:1064ifdef WINDOWS_SHELL1065 for %%x in (*.scm) do copy /b %%x +,,1066else1067 touch *.scm1068endif