~ 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_C_OBJECTS_1 = runtime utf42LIBCHICKEN_OBJECTS_1 = $(LIBCHICKEN_SCHEME_OBJECTS_1) $(LIBCHICKEN_C_OBJECTS_1)43LIBCHICKEN_SHARED_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=$(O))44LIBCHICKEN_STATIC_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=-static$(O)) \45 eval-modules-static$(O)4647COMPILER_OBJECTS_1 = \48 chicken batch-driver core optimizer lfa2 compiler-syntax scrutinizer support \49 c-platform c-backend user-pass50COMPILER_OBJECTS = $(COMPILER_OBJECTS_1:=$(O))51COMPILER_STATIC_OBJECTS = $(COMPILER_OBJECTS_1:=-static$(O))5253# "Utility programs" is arbitrary. It includes anything but the "chicken" binary.54# We can't use the INSTALLED_PROGRAMS below because of the possible $(EXE)55# suffix and other possible mangling requested by the user. (is this supported?)56UTILITY_PROGRAM_OBJECTS_1 = \57 csc csi chicken-install chicken-uninstall chicken-status chicken-profile5859# Not all programs built are installed(?) This is the master list that takes60# care of which programs should actually be installed/uninstalled61INSTALLED_PROGRAMS = \62 $(CHICKEN_PROGRAM) $(CSI_PROGRAM) $(CHICKEN_PROFILE_PROGRAM) \63 $(CSC_PROGRAM) \64 $(CHICKEN_DO_PROGRAM) $(CHICKEN_STATUS_PROGRAM) \65 $(CHICKEN_INSTALL_PROGRAM) $(CHICKEN_UNINSTALL_PROGRAM)6667# These generated files make up a bootstrapped distribution build.68# They are not cleaned by the 'clean' target, but only by 'spotless'.69DISTFILES = $(filter-out runtime.c utf.c,$(LIBCHICKEN_OBJECTS_1:=.c)) \70 $(UTILITY_PROGRAM_OBJECTS_1:=.c) \71 $(COMPILER_OBJECTS_1:=.c) \72 $(IMPORT_LIBRARIES:=.import.c) \73 $(DYNAMIC_IMPORT_LIBRARIES:=.import.scm) \74 $(foreach lib,$(DYNAMIC_CHICKEN_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \75 $(foreach lib,$(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \76 $(foreach lib,$(COMPILER_OBJECTS_1),chicken.compiler.$(lib).import.scm) \77 eval-modules.c posixunix.c posixwin.c78# Remove the duplicate $(POSIXFILE) entry:79DISTFILES := $(sort $(DISTFILES))8081# library objects8283## Any variable that starts with "declare-" is a meta-rule. When $(call)ed84## it produces output that represents an instantiated rule and recipe.85## This output then needs to be $(eval)ed in order to be added to the86## ruleset evaluated by Make. This allows us to automatically generate87## similar rules for long lists of targets.8889define declare-shared-library-object90$(1)$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)91 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \92 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) \93 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \94 $$(INCLUDES)95endef9697define declare-shared-library-c-object98$(1)$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)99 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \100 $$(C_COMPILER_COMPILE_OPTION) $$(RUNTIME_OPTIMIZATION_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) \101 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \102 $$(INCLUDES)103endef104105# The above meta-rule is reused in the setup API stuff below, so we alias it106declare-libchicken-object = $(declare-shared-library-object)107declare-libchicken-c-object = $(declare-shared-library-c-object)108109$(foreach obj, $(LIBCHICKEN_SCHEME_OBJECTS_1),\110 $(eval $(call declare-libchicken-object,$(obj))))111$(foreach obj, $(LIBCHICKEN_C_OBJECTS_1),\112 $(eval $(call declare-libchicken-c-object,$(obj))))113114# static versions115116define declare-static-library-object117$(1)-static$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)118 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \119 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) \120 $$(C_COMPILER_STATIC_OPTIONS) \121 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \122 $$(INCLUDES)123endef124125define declare-static-library-c-object126$(1)-static$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)127 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \128 $$(C_COMPILER_COMPILE_OPTION) $$(RUNTIME_OPTIMIZATION_OPTIONS) \129 $$(C_COMPILER_STATIC_OPTIONS) \130 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \131 $$(INCLUDES)132endef133134declare-static-libchicken-object = $(declare-static-library-object)135declare-static-libchicken-c-object = $(declare-static-library-c-object)136137$(foreach obj, $(LIBCHICKEN_SCHEME_OBJECTS_1),\138 $(eval $(call declare-static-libchicken-object,$(obj))))139$(foreach obj, $(LIBCHICKEN_C_OBJECTS_1),\140 $(eval $(call declare-static-libchicken-c-object,$(obj))))141142$(eval $(call declare-static-libchicken-object,eval-modules))143144# import library objects145146define declare-import-lib-object147$(1).import$(O): $(1).import.c chicken.h $$(CHICKEN_CONFIG_H)148 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \149 -DC_SHARED $$(C_COMPILER_COMPILE_OPTION) \150 $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) \151 $$(C_COMPILER_BUILD_RUNTIME_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \152 $$(INCLUDES)153endef154155$(foreach obj,$(IMPORT_LIBRARIES),\156 $(eval $(call declare-import-lib-object,$(obj))))157158# compiler objects159160define declare-compiler-object161$(1)$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)162 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \163 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) $$< \164 $$(C_COMPILER_OUTPUT) $$(INCLUDES)165endef166167$(foreach obj, $(COMPILER_OBJECTS_1),\168 $(eval $(call declare-compiler-object,$(obj))))169170# static compiler objects171172define declare-static-compiler-object173$(1)-static$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)174 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) \175 $$(C_COMPILER_STATIC_OPTIONS) \176 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \177 $$(INCLUDES)178endef179180$(foreach obj, $(COMPILER_OBJECTS_1),\181 $(eval $(call declare-static-compiler-object,$(obj))))182183# program objects184185define declare-utility-program-object186$(1)$(O): $(1).c chicken.h $$(CHICKEN_CONFIG_H)187 $$(C_COMPILER) $$(C_COMPILER_OPTIONS) $$(C_COMPILER_SHARED_OPTIONS) \188 $$(C_COMPILER_COMPILE_OPTION) $$(C_COMPILER_OPTIMIZATION_OPTIONS) $$< $$(C_COMPILER_OUTPUT) \189 $$(INCLUDES)190endef191192$(foreach obj, $(UTILITY_PROGRAM_OBJECTS_1),\193 $(eval $(call declare-utility-program-object,$(obj))))194195196# resource objects197198%.rc.o: %.rc199 $(RC_COMPILER) $< $@200201# libraries202203.PHONY: libs204205libs: $(TARGETLIBS)206207lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO): $(LIBCHICKEN_SHARED_OBJECTS)208 $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_LINKER_OPTIONS) \209 $(LINKER_OUTPUT) $^ $(LIBCHICKEN_SO_LIBRARIES)210ifdef USES_SONAME211 ln -sf $(LIBCHICKEN_SO_FILE) $(LIBCHICKEN_SO_FILE).$(BINARYVERSION)212endif213214cyg$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-0.dll: $(LIBCHICKEN_SHARED_OBJECTS)215 $(LINKER) -shared -o $(LIBCHICKEN_SO_FILE) -Wl,--dll -Wl,--add-stdcall-alias \216 -Wl,--enable-stdcall-fixup -Wl,--warn-unresolved-symbols \217 -Wl,--dll-search-prefix=cyg -Wl,--allow-multiple-definition \218 -Wl,--allow-shlib-undefined \219 -Wl,--out-implib=libchicken.dll.a -Wl,--export-all-symbols \220 -Wl,--enable-auto-import \221 -Wl,--whole-archive $(LIBCHICKEN_SHARED_OBJECTS) \222 -Wl,--no-whole-archive $(LIBCHICKEN_SO_LIBRARIES)223224lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A): $(LIBCHICKEN_STATIC_OBJECTS)225 $(LIBRARIAN) $(LIBRARIAN_OPTIONS) $(LIBRARIAN_OUTPUT) $^226227# import libraries and extensions228229%.so: %.o $(LIBCHICKEN_SO_FILE)230 $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_DLOADABLE_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ \231 $(LINKER_LIBRARY_PREFIX)$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(LINKER_LIBRARY_SUFFIX) \232 $(LIBRARIES)233234# executables235236$(CHICKEN_SHARED_EXECUTABLE): $(COMPILER_OBJECTS) $(PRIMARY_LIBCHICKEN)237 $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $(COMPILER_OBJECTS) $(LINKER_OUTPUT) \238 $(LINKER_LIBRARY_PREFIX)$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)239 $(PREINSTALL_PROGRAM_FIXUP) $(CHICKEN_SHARED_EXECUTABLE)240241define declare-program-from-object242$(1)-RC_FILE = $(if $(and $(RC_COMPILER),$(3)),$(2).rc$(O))243244$(1): $(2)$(O) $$(PRIMARY_LIBCHICKEN) $$($(1)-RC_FILE)245 $$(LINKER) $$(LINKER_OPTIONS) $$(LINKER_EXECUTABLE_OPTIONS) $$< \246 $$($(1)-RC_FILE) $$(LINKER_OUTPUT) \247 $$(LINKER_LIBRARY_PREFIX)$$(PROGRAM_PREFIX)chicken$$(PROGRAM_SUFFIX)$$(LINKER_LIBRARY_SUFFIX) \248 $$(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $$(LIBRARIES)249 $(PREINSTALL_PROGRAM_FIXUP) $(1)250endef251252# Unfortunately, we can't loop over INSTALLED_PROGRAMS here because of253# the possible name mangling and EXE suffixing in there :(254$(eval $(call declare-program-from-object,$(CSI_SHARED_EXECUTABLE),csi))255$(eval $(call declare-program-from-object,$(CHICKEN_INSTALL_PROGRAM)$(EXE),chicken-install,true))256$(eval $(call declare-program-from-object,$(CHICKEN_UNINSTALL_PROGRAM)$(EXE),chicken-uninstall,true))257$(eval $(call declare-program-from-object,$(CHICKEN_STATUS_PROGRAM)$(EXE),chicken-status))258$(eval $(call declare-program-from-object,$(CHICKEN_PROFILE_PROGRAM)$(EXE),chicken-profile))259$(eval $(call declare-program-from-object,$(CSC_PROGRAM)$(EXE),csc))260261# static executables262263$(CHICKEN_STATIC_EXECUTABLE): $(COMPILER_STATIC_OBJECTS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)264 $(LINKER) $(LINKER_OPTIONS) $(LINKER_STATIC_OPTIONS) $(COMPILER_STATIC_OBJECTS) $(LINKER_OUTPUT) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) $(LIBRARIES)265266define declare-static-program-from-object267$(1): $(2)$(O) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)268 $$(LINKER) $$(LINKER_OPTIONS) $$(LINKER_STATIC_OPTIONS) $$< $$(LINKER_OUTPUT) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) $$(LIBRARIES)269endef270271$(eval $(call declare-program-from-object,$(CSI_STATIC_EXECUTABLE),csi))272273# "chicken-do"274275$(CHICKEN_DO_PROGRAM)$(EXE): $(SRCDIR)chicken-do.c chicken.h $(CHICKEN_CONFIG_H)276 $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< -o $@277278279# installation280281.PHONY: install uninstall install-libs282.PHONY: install-target install-dev install-bin install-other-files install-wrappers283284install: $(TARGETS) install-target install-bin install-libs install-dev install-other-files285286install-target: install-libs287288install-libs: libs $(LIBCHICKEN_IMPORT_LIBRARY)289 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)"290ifneq ($(LIBCHICKEN_IMPORT_LIBRARY),)291 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) $(LIBCHICKEN_IMPORT_LIBRARY) "$(DESTDIR)$(ILIBDIR)"292endif293ifndef STATICBUILD294ifdef DLLSINPATH295 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)"296 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(IBINDIR)"297else298ifdef USES_SONAME299 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_SO_FILE).$(BINARYVERSION)"300 cd "$(DESTDIR)$(ILIBDIR)" && ln -sf $(LIBCHICKEN_SO_FILE).$(BINARYVERSION) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)301else302 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_SO_FILE)"303endif304endif305endif306307define NL308309310endef # A newline, used to inject recipe lines in a loop. Ugly, but necessary311312install-dev: install-libs313 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)"314 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ISHAREDIR)"315 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IEGGDIR)"316 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)"317 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDATADIR)"318 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) "$(DESTDIR)$(ILIBDIR)"319ifneq ($(POSTINSTALL_STATIC_LIBRARY),true)320 $(POSTINSTALL_STATIC_LIBRARY) $(POSTINSTALL_STATIC_LIBRARY_FLAGS) "$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)"321endif322 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.h "$(DESTDIR)$(ICHICKENINCDIR)"323 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(CHICKEN_CONFIG_H) "$(DESTDIR)$(ICHICKENINCDIR)"324ifdef WINDOWS325 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.ico "$(DESTDIR)$(IDATADIR)"326 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.rc$(O) "$(DESTDIR)$(IDATADIR)"327endif328 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)types.db "$(DESTDIR)$(IEGGDIR)"329330ifeq ($(NEEDS_RELINKING),yes)331install-bin: $(TARGETS) install-libs install-dev332 $(foreach prog,$(INSTALLED_PROGRAMS),\333 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(prog)$(EXE) $(NL))334335 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(IMPORT_LIBRARIES:%=%.so)336 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(IMPORT_LIBRARIES:%=%.import.so)337 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(LIBCHICKEN_SO_FILE)338 "$(MAKE)" PLATFORM=$(PLATFORM) CONFIG=$(CONFIG) NEEDS_RELINKING=no RUNTIME_LINKER_PATH="$(LIBDIR)" install-bin339# Damn. What was this for, again?340#341# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_PROGRAM)$(EXE) $(CSI_PROGRAM)$(EXE) $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE)342# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_INSTALL_PROGRAM)$(EXE)343# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE)344# $(MAKE_WRITABLE_COMMAND) $(CHICKEN_STATUS_PROGRAM)$(EXE)345else346install-bin: $(TARGETS) install-libs install-dev347 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)"348349 $(foreach prog,$(INSTALLED_PROGRAMS),\350 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) \351 $(prog)$(EXE) "$(DESTDIR)$(IBINDIR)" $(NL))352353ifdef STATICBUILD354 $(foreach lib,$(IMPORT_LIBRARIES),\355 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) \356 $(lib).import.scm "$(DESTDIR)$(IEGGDIR)" $(NL))357else358 $(foreach lib,$(IMPORT_LIBRARIES),\359 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) \360 $(lib).import.so "$(DESTDIR)$(IEGGDIR)" $(NL))361endif362363ifneq ($(POSTINSTALL_PROGRAM),true)364ifndef STATICBUILD365 $(foreach prog,$(INSTALLED_PROGRAMS),\366 $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) \367 "$(DESTDIR)$(IBINDIR)$(SEP)$(prog)" $(NL))368369 $(foreach import-lib,$(IMPORT_LIBRARIES),\370 $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) \371 "$(DESTDIR)$(IEGGDIR)$(SEP)$(import-lib).import.so" $(NL))372endif373endif374ifeq ($(CROSS_CHICKEN)$(DESTDIR),0)375 -$(IBINDIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM) -defaults $(SRCDIR)setup.defaults -update-db376 $(MAKE_READABLE_COMMAND) "$(DESTDIR)$(IEGGDIR)$(SEP)modules.db"377else378 @echo379 @echo "Warning: cannot run \`$(CHICKEN_INSTALL_PROGRAM) -update-db' when cross-compiling or DESTDIR is set"380 @echo381endif382endif383384install-other-files:385 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)"386 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDOCDIR)"387 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDATADIR)"388389 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROGRAM).1"390 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csc$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSC_PROGRAM).1"391 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csi$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSI_PROGRAM).1"392 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-do$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DO_PROGRAM).1"393 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-install$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM).1"394 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-uninstall$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM).1"395 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-status$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_STATUS_PROGRAM).1"396 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-profile$(MAN) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM).1"397398 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) "$(DESTDIR)$(IDOCDIR)$(SEP)manual"399 -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)manual-html$(SEP)* "$(DESTDIR)$(IDOCDIR)$(SEP)manual"400 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)README "$(DESTDIR)$(IDOCDIR)"401 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)DEPRECATED "$(DESTDIR)$(IDOCDIR)"402 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)LICENSE "$(DESTDIR)$(IDOCDIR)"403 $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)setup.defaults "$(DESTDIR)$(IDATADIR)"404405install-wrappers:406ifeq ($(WRAPPERDIR),)407 @echo408 @echo Error: WRAPPERDIR is not set409 @echo410 @exit 1411endif412 $(foreach prg, $(INSTALLED_PROGRAMS), \413 $(CSI) -s $(SRCDIR)scripts$(SEP)make-wrapper.scm $(prg) "$(WRAPPERDIR)" $(NL))414415uninstall:416 $(foreach prog,$(INSTALLED_PROGRAMS),\417 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS)\418 "$(DESTDIR)$(IBINDIR)$(SEP)$(prog)$(EXE)" $(NL))419 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A)"420 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)"421ifdef USES_SONAME422 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO).$(BINARYVERSION)"423endif424ifdef WINDOWS425 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)"426 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ILIBDIR)$(SEP)$(LIBCHICKEN_IMPORT_LIBRARY)"427endif428ifeq ($(PLATFORM),cygwin)429 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IBINDIR)$(SEP)cyg$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)*"430endif431432 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROGRAM).1"433 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSC_PROGRAM).1"434 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CSI_PROGRAM).1"435 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_DO_PROGRAM).1"436 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM).1"437 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_UNINSTALL_PROGRAM).1"438 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_STATUS_PROGRAM).1"439 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(IMAN1DIR)$(SEP)$(CHICKEN_PROFILE_PROGRAM).1"440441 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)$(SEP)chicken.h"442 $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) "$(DESTDIR)$(ICHICKENINCDIR)$(SEP)$(CHICKEN_CONFIG_H)"443 $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) "$(DESTDIR)$(IDATADIR)"444 $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) "$(DESTDIR)$(IEGGDIR)"445446# build versioning447448ifdef WINDOWS_SHELL449buildbranch:450 echo.$(BRANCHNAME)>buildbranch451buildid:452 echo.$(BUILD_ID)>buildid453else454.PHONY: identify-me455456identify-me:457 @sh $(SRCDIR)identify.sh $(SRCDIR)458459buildbranch: identify-me460buildid: identify-me461endif462463# bootstrapping c sources464465define declare-emitted-import-lib-dependency466.SECONDARY: $(1).import.scm467$(1).import.scm: $(2).c468endef469470define declare-emitted-chicken-import-lib-dependency471$(call declare-emitted-import-lib-dependency,chicken.$(1),$(1))472endef473474define declare-emitted-compiler-import-lib-dependency475$(call declare-emitted-import-lib-dependency,chicken.compiler.$(1),$(1))476endef477478$(foreach lib, $(DYNAMIC_IMPORT_LIBRARIES),\479 $(eval $(call declare-emitted-import-lib-dependency,$(lib),$(lib))))480481$(foreach lib, $(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),\482 $(eval $(call declare-emitted-chicken-import-lib-dependency,$(lib))))483484$(foreach lib, $(COMPILER_OBJECTS_1),\485 $(eval $(call declare-emitted-compiler-import-lib-dependency,$(lib))))486487# special cases for modules not corresponding directly to units488$(eval $(call declare-emitted-import-lib-dependency,chicken.errno,$(POSIXFILE)))489$(eval $(call declare-emitted-import-lib-dependency,chicken.file.posix,$(POSIXFILE)))490$(eval $(call declare-emitted-import-lib-dependency,chicken.time.posix,$(POSIXFILE)))491$(eval $(call declare-emitted-import-lib-dependency,chicken.process,$(POSIXFILE)))492$(eval $(call declare-emitted-import-lib-dependency,chicken.process.signal,$(POSIXFILE)))493$(eval $(call declare-emitted-import-lib-dependency,chicken.process-context.posix,$(POSIXFILE)))494$(eval $(call declare-emitted-import-lib-dependency,chicken.bitwise,library))495$(eval $(call declare-emitted-import-lib-dependency,chicken.bytevector,library))496$(eval $(call declare-emitted-import-lib-dependency,chicken.fixnum,library))497$(eval $(call declare-emitted-import-lib-dependency,chicken.flonum,library))498$(eval $(call declare-emitted-import-lib-dependency,chicken.gc,library))499$(eval $(call declare-emitted-import-lib-dependency,chicken.keyword,library))500$(eval $(call declare-emitted-import-lib-dependency,chicken.platform,library))501$(eval $(call declare-emitted-import-lib-dependency,chicken.plist,library))502$(eval $(call declare-emitted-import-lib-dependency,chicken.process-context,library))503$(eval $(call declare-emitted-import-lib-dependency,chicken.time,library))504$(eval $(call declare-emitted-import-lib-dependency,chicken.load,eval))505$(eval $(call declare-emitted-import-lib-dependency,chicken.format,extras))506$(eval $(call declare-emitted-import-lib-dependency,chicken.io,library))507$(eval $(call declare-emitted-import-lib-dependency,chicken.pretty-print,extras))508$(eval $(call declare-emitted-import-lib-dependency,chicken.version,extras))509$(eval $(call declare-emitted-import-lib-dependency,chicken.random,extras))510$(eval $(call declare-emitted-import-lib-dependency,chicken.locative,lolevel))511$(eval $(call declare-emitted-import-lib-dependency,chicken.memory,lolevel))512$(eval $(call declare-emitted-import-lib-dependency,chicken.memory.representation,lolevel))513$(eval $(call declare-emitted-import-lib-dependency,chicken.number-vector,srfi-4))514$(eval $(call declare-emitted-import-lib-dependency,chicken.sort,data-structures))515$(eval $(call declare-emitted-import-lib-dependency,chicken.string,data-structures))516$(eval $(call declare-emitted-import-lib-dependency,scheme.write,r7lib))517$(eval $(call declare-emitted-import-lib-dependency,scheme.time,r7lib))518$(eval $(call declare-emitted-import-lib-dependency,scheme.file,r7lib))519$(eval $(call declare-emitted-import-lib-dependency,scheme.process-context,r7lib))520521chicken.c: chicken.scm mini-srfi-1.scm \522 chicken.compiler.batch-driver.import.scm \523 chicken.compiler.c-platform.import.scm \524 chicken.compiler.support.import.scm \525 chicken.compiler.user-pass.import.scm \526 chicken.process-context.import.scm \527 chicken.string.import.scm528batch-driver.c: batch-driver.scm mini-srfi-1.scm \529 chicken.compiler.core.import.scm \530 chicken.compiler.compiler-syntax.import.scm \531 chicken.compiler.optimizer.import.scm \532 chicken.compiler.scrutinizer.import.scm \533 chicken.compiler.c-platform.import.scm \534 chicken.compiler.lfa2.import.scm \535 chicken.compiler.c-backend.import.scm \536 chicken.compiler.support.import.scm \537 chicken.compiler.user-pass.import.scm \538 chicken.format.import.scm \539 chicken.gc.import.scm \540 chicken.internal.import.scm \541 chicken.load.import.scm \542 chicken.pathname.import.scm \543 chicken.platform.import.scm \544 chicken.pretty-print.import.scm \545 chicken.process-context.import.scm \546 chicken.process-context.posix.import.scm \547 chicken.condition.import.scm \548 chicken.port.import.scm \549 chicken.string.import.scm \550 chicken.syntax.import.scm \551 chicken.time.import.scm552c-platform.c: c-platform.scm mini-srfi-1.scm \553 chicken.compiler.optimizer.import.scm \554 chicken.compiler.support.import.scm \555 chicken.compiler.core.import.scm \556 chicken.internal.import.scm557c-backend.c: c-backend.scm mini-srfi-1.scm \558 chicken.compiler.c-platform.import.scm \559 chicken.compiler.support.import.scm \560 chicken.compiler.core.import.scm \561 chicken.bitwise.import.scm \562 chicken.flonum.import.scm \563 chicken.foreign.import.scm \564 chicken.format.import.scm \565 chicken.internal.import.scm \566 chicken.sort.import.scm \567 chicken.string.import.scm \568 chicken.time.import.scm569core.c: core.scm mini-srfi-1.scm \570 chicken.compiler.scrutinizer.import.scm \571 chicken.compiler.support.import.scm \572 chicken.eval.import.scm \573 chicken.file.import.scm \574 chicken.fixnum.import.scm \575 chicken.format.import.scm \576 chicken.io.import.scm \577 chicken.keyword.import.scm \578 chicken.load.import.scm \579 chicken.pretty-print.import.scm \580 chicken.string.import.scm \581 chicken.syntax.import.scm582optimizer.c: optimizer.scm mini-srfi-1.scm \583 chicken.compiler.support.import.scm \584 chicken.fixnum.import.scm \585 chicken.internal.import.scm \586 chicken.sort.import.scm \587 chicken.string.import.scm588scheduler.c: scheduler.scm \589 chicken.fixnum.import.scm \590 chicken.format.import.scm \591 chicken.condition.import.scm592scrutinizer.c: scrutinizer.scm mini-srfi-1.scm \593 chicken.compiler.support.import.scm \594 chicken.fixnum.import.scm \595 chicken.format.import.scm \596 chicken.internal.import.scm \597 chicken.io.import.scm \598 chicken.pathname.import.scm \599 chicken.platform.import.scm \600 chicken.sort.import.scm \601 chicken.port.import.scm \602 chicken.pretty-print.import.scm \603 chicken.string.import.scm604lfa2.c: lfa2.scm mini-srfi-1.scm \605 chicken.compiler.support.import.scm \606 chicken.format.import.scm607compiler-syntax.c: compiler-syntax.scm mini-srfi-1.scm \608 chicken.compiler.support.import.scm \609 chicken.compiler.core.import.scm \610 chicken.fixnum.import.scm \611 chicken.format.import.scm \612 chicken.syntax.import.scm613chicken-ffi-syntax.c: chicken-ffi-syntax.scm \614 chicken.format.import.scm \615 chicken.internal.import.scm \616 chicken.string.import.scm617support.c: support.scm mini-srfi-1.scm \618 chicken.bitwise.import.scm \619 chicken.bytevector.import.scm \620 chicken.condition.import.scm \621 chicken.file.import.scm \622 chicken.fixnum.import.scm \623 chicken.foreign.import.scm \624 chicken.format.import.scm \625 chicken.internal.import.scm \626 chicken.io.import.scm \627 chicken.keyword.import.scm \628 chicken.pathname.import.scm \629 chicken.platform.import.scm \630 chicken.plist.import.scm \631 chicken.port.import.scm \632 chicken.pretty-print.import.scm \633 chicken.random.import.scm \634 chicken.sort.import.scm \635 chicken.string.import.scm \636 chicken.time.import.scm \637 banner.scm638modules.c: modules.scm \639 chicken.internal.import.scm \640 chicken.format.import.scm \641 chicken.keyword.import.scm \642 chicken.base.import.scm \643 chicken.syntax.import.scm \644 chicken.load.import.scm \645 chicken.platform.import.scm646csc.c: csc.scm \647 chicken.file.import.scm \648 chicken.foreign.import.scm \649 chicken.format.import.scm \650 chicken.io.import.scm \651 chicken.pathname.import.scm \652 chicken.process.import.scm \653 chicken.process-context.import.scm \654 chicken.string.import.scm655csi.c: csi.scm \656 chicken.condition.import.scm \657 chicken.file.import.scm \658 chicken.foreign.import.scm \659 chicken.format.import.scm \660 chicken.gc.import.scm \661 chicken.internal.import.scm \662 chicken.io.import.scm \663 chicken.keyword.import.scm \664 chicken.load.import.scm \665 chicken.platform.import.scm \666 chicken.port.import.scm \667 chicken.pretty-print.import.scm \668 chicken.process.import.scm \669 chicken.process-context.import.scm \670 chicken.repl.import.scm \671 chicken.sort.import.scm \672 chicken.string.import.scm \673 scheme.write.import.scm674chicken-profile.c: chicken-profile.scm \675 chicken.internal.import.scm \676 chicken.file.import.scm \677 chicken.file.posix.import.scm \678 chicken.fixnum.import.scm \679 chicken.process-context.import.scm \680 chicken.sort.import.scm \681 chicken.string.import.scm682chicken-status.c: chicken-status.scm \683 chicken.file.import.scm \684 chicken.file.posix.import.scm \685 chicken.fixnum.import.scm \686 chicken.foreign.import.scm \687 chicken.format.import.scm \688 chicken.irregex.import.scm \689 chicken.pathname.import.scm \690 chicken.port.import.scm \691 chicken.pretty-print.import.scm \692 chicken.process-context.import.scm \693 chicken.sort.import.scm \694 chicken.string.import.scm695chicken-install.c: chicken-install.scm \696 chicken.condition.import.scm \697 chicken.file.import.scm \698 chicken.file.posix.import.scm \699 chicken.fixnum.import.scm \700 chicken.foreign.import.scm \701 chicken.format.import.scm \702 chicken.internal.import.scm \703 chicken.io.import.scm \704 chicken.irregex.import.scm \705 chicken.pathname.import.scm \706 chicken.port.import.scm \707 chicken.pretty-print.import.scm \708 chicken.process.import.scm \709 chicken.process-context.import.scm \710 chicken.sort.import.scm \711 chicken.string.import.scm \712 chicken.version.import.scm \713 chicken.tcp.import.scm714chicken-uninstall.c: chicken-uninstall.scm \715 chicken.file.import.scm \716 chicken.fixnum.import.scm \717 chicken.foreign.import.scm \718 chicken.format.import.scm \719 chicken.irregex.import.scm \720 chicken.pathname.import.scm \721 chicken.port.import.scm \722 chicken.process.import.scm \723 chicken.process-context.import.scm \724 chicken.string.import.scm725chicken-syntax.c: chicken-syntax.scm \726 chicken.fixnum.import.scm \727 chicken.platform.import.scm \728 chicken.internal.import.scm729srfi-4.c: srfi-4.scm \730 chicken.bitwise.import.scm \731 chicken.bytevector.import.scm \732 chicken.fixnum.import.scm \733 chicken.foreign.import.scm \734 chicken.gc.import.scm \735 chicken.platform.import.scm736posixunix.c: posixunix.scm \737 chicken.bitwise.import.scm \738 chicken.condition.import.scm \739 chicken.foreign.import.scm \740 chicken.memory.import.scm \741 chicken.pathname.import.scm \742 chicken.platform.import.scm \743 chicken.port.import.scm \744 chicken.process-context.import.scm \745 chicken.time.import.scm746posixwin.c: posixwin.scm \747 chicken.condition.import.scm \748 chicken.bitwise.import.scm \749 chicken.foreign.import.scm \750 chicken.memory.import.scm \751 chicken.pathname.import.scm \752 chicken.platform.import.scm \753 chicken.port.import.scm \754 chicken.process-context.import.scm \755 chicken.string.import.scm \756 chicken.time.import.scm757data-structures.c: data-structures.scm \758 chicken.condition.import.scm \759 chicken.fixnum.import.scm \760 chicken.foreign.import.scm761expand.c: expand.scm \762 chicken.bytevector.import.scm \763 chicken.condition.import.scm \764 chicken.fixnum.import.scm \765 chicken.keyword.import.scm \766 chicken.platform.import.scm \767 chicken.string.import.scm \768 chicken.internal.import.scm769extras.c: extras.scm \770 chicken.fixnum.import.scm \771 chicken.string.import.scm \772 chicken.time.import.scm773eval.c: eval.scm \774 chicken.bytevector.import.scm \775 chicken.condition.import.scm \776 chicken.fixnum.import.scm \777 chicken.foreign.import.scm \778 chicken.internal.import.scm \779 chicken.keyword.import.scm \780 chicken.syntax.import.scm \781 chicken.platform.import.scm782repl.c: repl.scm \783 chicken.eval.import.scm784file.c: file.scm \785 chicken.condition.import.scm \786 chicken.fixnum.import.scm \787 chicken.io.import.scm \788 chicken.irregex.import.scm \789 chicken.foreign.import.scm \790 chicken.pathname.import.scm \791 chicken.process-context.import.scm792lolevel.c: lolevel.scm \793 chicken.fixnum.import.scm \794 chicken.foreign.import.scm795pathname.c: pathname.scm \796 chicken.fixnum.import.scm \797 chicken.irregex.import.scm \798 chicken.platform.import.scm \799 chicken.string.import.scm800port.c: port.scm \801 chicken.fixnum.import.scm \802 chicken.io.import.scm803read-syntax.c: read-syntax.scm \804 chicken.internal.import.scm \805 chicken.platform.import.scm806tcp.c: tcp.scm \807 chicken.fixnum.import.scm \808 chicken.foreign.import.scm \809 chicken.port.import.scm \810 chicken.time.import.scm811eval-modules.c: eval-modules.scm $(DYNAMIC_IMPORT_LIBRARIES:=.import.scm) \812 $(foreach lib,$(DYNAMIC_CHICKEN_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \813 $(foreach lib,$(DYNAMIC_CHICKEN_UNIT_IMPORT_LIBRARIES),$(lib).c)814continuation.c: continuation.scm \815 chicken.fixnum.import.scm816internal.c: internal.scm \817 chicken.fixnum.import.scm818irregex.c: irregex.scm \819 chicken.fixnum.import.scm \820 chicken.syntax.import.scm821profiler.c: profiler.scm \822 chicken.fixnum.import.scm823stub.c: stub.scm \824 chicken.platform.import.scm825r7lib.c: r7lib.scm \826 chicken.platform.import.scm \827 chicken.process-context.import.scm \828 chicken.time.import.scm \829 chicken.io.import.scm \830 chicken.file.import.scm831832define profile-flags833$(if $(filter $(basename $(1)),$(PROFILE_OBJECTS)),-profile)834endef835836bootstrap-lib = $(CHICKEN) $(call profile-flags, $@) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@837838library.c: $(SRCDIR)library.scm839 $(bootstrap-lib) \840 -no-module-registration \841 -emit-import-library chicken.bitwise \842 -emit-import-library chicken.bytevector \843 -emit-import-library chicken.fixnum \844 -emit-import-library chicken.flonum \845 -emit-import-library chicken.gc \846 -emit-import-library chicken.keyword \847 -emit-import-library chicken.platform \848 -emit-import-library chicken.plist \849 -emit-import-library chicken.io \850 -emit-import-library chicken.process-context851internal.c: $(SRCDIR)internal.scm $(SRCDIR)mini-srfi-1.scm852 $(bootstrap-lib) -emit-import-library chicken.internal853eval.c: $(SRCDIR)eval.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm854 $(bootstrap-lib) \855 -emit-import-library chicken.eval \856 -emit-import-library chicken.load857r7lib.c: $(SRCDIR)r7lib.scm $(SRCDIR)common-declarations.scm858 $(bootstrap-lib) -emit-import-library scheme.write \859 -emit-import-library scheme.time \860 -emit-import-library scheme.file \861 -emit-import-library scheme.process-context862read-syntax.c: $(SRCDIR)read-syntax.scm $(SRCDIR)common-declarations.scm863 $(bootstrap-lib) -emit-import-library chicken.read-syntax864repl.c: $(SRCDIR)repl.scm $(SRCDIR)common-declarations.scm865 $(bootstrap-lib) -emit-import-library chicken.repl866expand.c: $(SRCDIR)expand.scm $(SRCDIR)synrules.scm $(SRCDIR)common-declarations.scm867 $(bootstrap-lib) \868 -no-module-registration869modules.c: $(SRCDIR)modules.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm870 $(bootstrap-lib)871extras.c: $(SRCDIR)extras.scm $(SRCDIR)common-declarations.scm872 $(bootstrap-lib) \873 -emit-import-library chicken.format \874 -emit-import-library chicken.pretty-print \875 -emit-import-library chicken.random \876 -emit-import-library chicken.version877posixunix.c: $(SRCDIR)posix.scm $(SRCDIR)posixunix.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm878 $(bootstrap-lib) -feature platform-unix \879 -emit-import-library chicken.errno \880 -emit-import-library chicken.file.posix \881 -emit-import-library chicken.time.posix \882 -emit-import-library chicken.process \883 -emit-import-library chicken.process.signal \884 -emit-import-library chicken.process-context.posix \885 -no-module-registration886posixwin.c: $(SRCDIR)posix.scm $(SRCDIR)posixwin.scm $(SRCDIR)posix-common.scm $(SRCDIR)common-declarations.scm887 $(bootstrap-lib) -feature platform-windows \888 -emit-import-library chicken.errno \889 -emit-import-library chicken.file.posix \890 -emit-import-library chicken.time.posix \891 -emit-import-library chicken.process \892 -emit-import-library chicken.process.signal \893 -emit-import-library chicken.process-context.posix \894 -no-module-registration895irregex.c: $(SRCDIR)irregex.scm $(SRCDIR)irregex-core.scm $(SRCDIR)irregex-utils.scm $(SRCDIR)common-declarations.scm896 $(bootstrap-lib) -emit-import-library chicken.irregex897chicken-syntax.c: $(SRCDIR)chicken-syntax.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm898 $(bootstrap-lib)899chicken-ffi-syntax.c: $(SRCDIR)chicken-ffi-syntax.scm $(SRCDIR)common-declarations.scm $(SRCDIR)mini-srfi-1.scm900 $(bootstrap-lib)901continuation.c: $(SRCDIR)continuation.scm $(SRCDIR)common-declarations.scm902 $(bootstrap-lib) -emit-import-library chicken.continuation903data-structures.c: $(SRCDIR)data-structures.scm $(SRCDIR)common-declarations.scm904 $(bootstrap-lib) \905 -emit-import-library chicken.sort \906 -emit-import-library chicken.string907pathname.c: $(SRCDIR)pathname.scm $(SRCDIR)common-declarations.scm908 $(bootstrap-lib) -emit-import-library chicken.pathname909port.c: $(SRCDIR)port.scm $(SRCDIR)common-declarations.scm910 $(bootstrap-lib) -emit-import-library chicken.port911file.c: $(SRCDIR)file.scm $(SRCDIR)common-declarations.scm912 $(bootstrap-lib) -emit-import-library chicken.file913lolevel.c: $(SRCDIR)lolevel.scm $(SRCDIR)common-declarations.scm914 $(bootstrap-lib) \915 -emit-import-library chicken.locative \916 -emit-import-library chicken.memory \917 -emit-import-library chicken.memory.representation918tcp.c: $(SRCDIR)tcp.scm $(SRCDIR)common-declarations.scm919 $(bootstrap-lib) -emit-import-library chicken.tcp920srfi-4.c: $(SRCDIR)srfi-4.scm $(SRCDIR)common-declarations.scm921 $(bootstrap-lib) -emit-import-library srfi-4 \922 -emit-import-library chicken.number-vector923scheduler.c: $(SRCDIR)scheduler.scm $(SRCDIR)common-declarations.scm924 $(bootstrap-lib)925profiler.c: $(SRCDIR)profiler.scm $(SRCDIR)common-declarations.scm926 $(bootstrap-lib)927stub.c: $(SRCDIR)stub.scm $(SRCDIR)common-declarations.scm928 $(bootstrap-lib)929debugger-client.c: $(SRCDIR)debugger-client.scm $(SRCDIR)common-declarations.scm dbg-stub.c930 $(bootstrap-lib)931build-version.c: $(SRCDIR)build-version.scm $(SRCDIR)buildversion buildbranch buildid932 $(bootstrap-lib)933eval-modules.c: $(SRCDIR)eval-modules.scm $(SRCDIR)common-declarations.scm934 $(bootstrap-lib)935936define declare-bootstrap-import-lib937$(1).import.c: $$(SRCDIR)$(1).import.scm938 $$(CHICKEN) $$< $$(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $$@939endef940941$(foreach obj, $(IMPORT_LIBRARIES),\942 $(eval $(call declare-bootstrap-import-lib,$(obj))))943944# Bootstrap compiler objects945946define declare-bootstrap-compiler-object947$(1).c: $$(SRCDIR)$(1).scm $$(SRCDIR)tweaks.scm948 $$(CHICKEN) $$< $$(CHICKEN_PROGRAM_OPTIONS) -emit-import-library chicken.compiler.$(1) \949 -output-file $$@950endef951952$(foreach obj, $(COMPILER_OBJECTS_1),\953 $(eval $(call declare-bootstrap-compiler-object,$(obj))))954955csi.c: $(SRCDIR)csi.scm $(SRCDIR)banner.scm $(SRCDIR)mini-srfi-1.scm956 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@957chicken-profile.c: $(SRCDIR)chicken-profile.scm $(SRCDIR)mini-srfi-1.scm958 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@959chicken-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.scm960 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@961chicken-uninstall.c: $(SRCDIR)chicken-uninstall.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm $(SRCDIR)egg-information.scm962 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@963chicken-status.c: $(SRCDIR)chicken-status.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm $(SRCDIR)egg-information.scm964 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@965csc.c: $(SRCDIR)csc.scm $(SRCDIR)mini-srfi-1.scm $(SRCDIR)egg-environment.scm966 $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@967968# distribution files969970.PHONY: distfiles dist html971972distfiles: $(DISTFILES)973974dist: distfiles html975 echo '# this file is intentionally empty' > config.make976 CSI=$(CSI) $(CSI) -s $(SRCDIR)scripts$(SEP)makedist.scm -platform $(PLATFORM) CHICKEN=$(CHICKEN)977978# Jim's `manual-labor' must be installed (just run "chicken-install manual-labor")979html:980 $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(SRCDIR)manual-html981 manual-labor $(SRCDIR)manual $(SRCDIR)manual-html982 $(COPY_COMMAND) $(SRCDIR)chicken.png manual-html983 $(COPY_COMMAND) $(SRCDIR)manual.css manual-html984 $(COPY_COMMAND) $(SRCDIR)index.html manual-html985986# cleaning up987988.PHONY: clean spotless confclean testclean989990BUILD_CONFIG_FILES = chicken-config.h chicken-defaults.h chicken-install.rc chicken-uninstall.rc991992clean:993 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(EXE) $(PROGRAM_PREFIX)csi$(PROGRAM_SUFFIX)$(EXE) $(PROGRAM_PREFIX)csc$(PROGRAM_SUFFIX)$(EXE) \994 $(CHICKEN_PROFILE_PROGRAM)$(EXE) \995 $(CHICKEN_INSTALL_PROGRAM)$(EXE) \996 $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) \997 $(CHICKEN_STATUS_PROGRAM)$(EXE) \998 *$(O) \999 $(CHICKEN_DO_PROGRAM)$(EXE) \1000 $(LIBCHICKEN_SO_FILE) \1001 $(PRIMARY_LIBCHICKEN) \1002 lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)-static$(A) \1003 $(IMPORT_LIBRARIES:=.import.so) $(LIBCHICKEN_IMPORT_LIBRARY) \1004 $(foreach lib,$(DYNAMIC_IMPORT_LIBRARIES),chicken.$(lib).import.scm) \1005 $(BUILD_CONFIG_FILES)1006ifdef USES_SONAME1007 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX).so.$(BINARYVERSION)1008endif10091010confclean:1011 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(BUILD_CONFIG_FILES)1012 touch config.make10131014spotless: clean testclean1015 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DISTFILES) \1016 buildid buildbranch10171018testclean:1019 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) \1020 $(SRCDIR)tests$(SEP)*.dll \1021 $(SRCDIR)tests$(SEP)*.import.scm \1022 $(SRCDIR)tests$(SEP)*.inline \1023 $(SRCDIR)tests$(SEP)*.link \1024 $(SRCDIR)tests$(SEP)*.o \1025 $(SRCDIR)tests$(SEP)*.out \1026 $(SRCDIR)tests$(SEP)*.profile \1027 $(SRCDIR)tests$(SEP)*.redacted \1028 $(SRCDIR)tests$(SEP)*.so \1029 $(SRCDIR)tests$(SEP)tmp \1030 $(SRCDIR)tests$(SEP)tmp.c \1031 $(SRCDIR)tests$(SEP)empty-file \1032 $(SRCDIR)tests$(SEP)null \1033 $(SRCDIR)tests$(SEP)null.c \1034 $(SRCDIR)tests$(SEP)null.exe \1035 $(SRCDIR)tests$(SEP)test-repository \1036 $(SRCDIR)tests$(SEP)redact-gensyms10371038# run tests10391040.PHONY: check10411042export PROGRAM_PREFIX1043export PROGRAM_SUFFIX10441045check: $(TARGETS)1046 cd tests; sh runtests.sh104710481049# build static bootstrapping chicken10501051.PHONY: boot-chicken bootclean10521053STAGE1_CONFIG = PLATFORM=$(PLATFORM) PREFIX=/nowhere CONFIG= \1054 CHICKEN=$(CHICKEN) PROGRAM_SUFFIX=-boot-stage1 STATICBUILD=1 \1055 C_COMPILER_OPTIMIZATION_OPTIONS="$(C_COMPILER_OPTIMIZATION_OPTIONS)" BUILDING_CHICKEN_BOOT=110561057BOOT_CONFIG = PLATFORM=$(PLATFORM) PREFIX=/nowhere CONFIG= \1058 CHICKEN=.$(SEP)chicken-boot-stage1$(EXE) PROGRAM_SUFFIX=-boot \1059 STATICBUILD=1 C_COMPILER_OPTIMIZATION_OPTIONS="$(C_COMPILER_OPTIMIZATION_OPTIONS)"10601061boot-chicken:1062 "$(MAKE)" $(STAGE1_CONFIG) confclean1063 "$(MAKE)" $(STAGE1_CONFIG) chicken-boot-stage1$(EXE)1064 "$(MAKE)" $(BOOT_CONFIG) touchfiles1065 "$(MAKE)" $(BOOT_CONFIG) chicken-boot$(EXE)1066 "$(MAKE)" $(BOOT_CONFIG) confclean10671068bootclean:1069 -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) \1070 $(SRCDIR)chicken-boot$(EXE) \1071 $(SRCDIR)chicken-boot-stage1$(EXE) \1072 $(SRCDIR)libchicken-boot$(A) \1073 $(SRCDIR)libchicken-boot-stage1$(A)10741075.PHONY: touchfiles10761077touchfiles:1078ifdef WINDOWS_SHELL1079 for %%x in (*.scm) do copy /b %%x +,,1080else1081 touch *.scm1082endif