Ignore:
Timestamp:
02/10/09 17:33:27 (12 years ago)
Author:
felix winkelmann
Message:

merged trunk svn rev. 13239 into prerelease

Location:
chicken/branches/prerelease
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/prerelease

  • chicken/branches/prerelease/rules.make

    r11975 r13240  
    22#
    33# Copyright (c) 2000-2007, Felix L. Winkelmann
    4 # Copyright (c) 2008, The Chicken Team
     4# Copyright (c) 2008-2009, The Chicken Team
    55# All rights reserved.
    66#
     
    2525# POSSIBILITY OF SUCH DAMAGE.
    2626
    27 VPATH=$(SRCDIR):$(SRCDIR)/pcre
     27VPATH=$(SRCDIR)
    2828
    2929# object files
     
    3232       library eval data-structures ports files extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
    3333       srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex scheduler \
    34        profiler stub match runtime
     34       profiler stub expand chicken-syntax runtime
    3535LIBCHICKEN_SHARED_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=$(O))
    3636LIBCHICKEN_STATIC_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=-static$(O))
     
    3939       ulibrary ueval udata-structures uports ufiles uextras ulolevel uutils utcp usrfi-1 usrfi-4 \
    4040       usrfi-13 usrfi-14 usrfi-18 usrfi-69 u$(POSIXFILE) uregex scheduler \
    41        profiler stub match uruntime
     41       profiler stub expand chicken-syntax uruntime
    4242LIBUCHICKEN_SHARED_OBJECTS = $(LIBUCHICKEN_OBJECTS_1:=$(O))
    4343LIBUCHICKEN_STATIC_OBJECTS = $(LIBUCHICKEN_OBJECTS_1:=-static$(O))
     
    4646       library eval data-structures ports files extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
    4747       srfi-14 srfi-18 srfi-69 $(POSIXFILE) regex scheduler \
    48        profiler stub match gui-runtime
     48       profiler stub expand chicken-syntax gui-runtime
    4949LIBCHICKENGUI_SHARED_OBJECTS = $(LIBCHICKENGUI_OBJECTS_1:=$(O))
    5050LIBCHICKENGUI_STATIC_OBJECTS = $(LIBCHICKENGUI_OBJECTS_1:=-static$(O))
    51 
    52 ifeq ($(USE_HOST_PCRE),)
    53 PCRE_OBJECTS_1 ?= \
    54        $(PCRE_DIR)pcre_compile \
    55        $(PCRE_DIR)pcre_config \
    56        $(PCRE_DIR)pcre_dfa_exec \
    57        $(PCRE_DIR)pcre_exec \
    58        $(PCRE_DIR)pcre_fullinfo \
    59        $(PCRE_DIR)pcre_get \
    60        $(PCRE_DIR)pcre_globals \
    61        $(PCRE_DIR)pcre_info \
    62        $(PCRE_DIR)pcre_maketables \
    63        $(PCRE_DIR)pcre_newline \
    64        $(PCRE_DIR)pcre_ord2utf8 \
    65        $(PCRE_DIR)pcre_refcount \
    66        $(PCRE_DIR)pcre_study \
    67        $(PCRE_DIR)pcre_tables \
    68        $(PCRE_DIR)pcre_try_flipped \
    69        $(PCRE_DIR)pcre_ucp_searchfuncs \
    70        $(PCRE_DIR)pcre_valid_utf8 \
    71        $(PCRE_DIR)pcre_version \
    72        $(PCRE_DIR)pcre_xclass \
    73        $(PCRE_DIR)pcre_chartables
    74 PCRE_SHARED_OBJECTS = $(PCRE_OBJECTS_1:=$(O))
    75 PCRE_STATIC_OBJECTS = $(PCRE_OBJECTS_1:=-static$(O))
    76 endif
    7751
    7852COMPILER_OBJECTS_1 = \
     
    8256COMPILER_STATIC_OBJECTS = $(COMPILER_OBJECTS_1:=-static$(O))
    8357
     58
    8459# library objects
    8560
     
    9772          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    9873          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     74expand$(O): expand.c chicken.h $(CHICKEN_CONFIG_H)
     75        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     76          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     77          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     78chicken-syntax$(O): chicken-syntax.c chicken.h $(CHICKEN_CONFIG_H)
     79        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     80          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     81          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    9982data-structures$(O): data-structures.c chicken.h $(CHICKEN_CONFIG_H)
    10083        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     
    121104          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    122105          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    123 match$(O): match.c chicken.h $(CHICKEN_CONFIG_H)
    124         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    125           $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    126           $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    127106posixunix$(O): posixunix.c chicken.h $(CHICKEN_CONFIG_H)
    128107        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     
    138117          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    139118regex$(O): regex.c chicken.h $(CHICKEN_CONFIG_H)
    140         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(PCRE_INCLUDES) \
    141           $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    142           $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $(C_COMPILER_PCRE_OPTIONS) $< $(C_COMPILER_OUTPUT)
     119        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) \
     120          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     121          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    143122scheduler$(O): scheduler.c chicken.h $(CHICKEN_CONFIG_H)
    144123        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     
    223202          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    224203uregex$(O): uregex.c chicken.h $(CHICKEN_CONFIG_H)
    225         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(PCRE_INCLUDES) \
    226           $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    227           $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $(C_COMPILER_PCRE_OPTIONS) $< $(C_COMPILER_OUTPUT)
     204        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) \
     205          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
     206          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    228207usrfi-1$(O): usrfi-1.c chicken.h $(CHICKEN_CONFIG_H)
    229         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(PCRE_INCLUDES) \
     208        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) \
    230209          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) \
    231210          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     
    262241        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    263242          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     243          $(C_COMPILER_STATIC_OPTIONS) \
    264244          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    265245gui-runtime-static$(O): runtime.c chicken.h $(CHICKEN_CONFIG_H)
    266246        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    267247          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     248          $(C_COMPILER_STATIC_OPTIONS) \
    268249          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $(C_COMPILER_GUI_RUNTIME_OPTIONS) $< \
    269250          $(C_COMPILER_OUTPUT)
    270251eval-static$(O): eval.c chicken.h $(CHICKEN_CONFIG_H)
    271252        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    272           $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     253          $(C_COMPILER_STATIC_OPTIONS) \
     254          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     255          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     256expand-static$(O): expand.c chicken.h $(CHICKEN_CONFIG_H)
     257        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     258          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     259          $(C_COMPILER_STATIC_OPTIONS) \
     260          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     261chicken-syntax-static$(O): chicken-syntax.c chicken.h $(CHICKEN_CONFIG_H)
     262        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     263          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     264          $(C_COMPILER_STATIC_OPTIONS) \
    273265          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    274266data-structures-static$(O): data-structures.c chicken.h $(CHICKEN_CONFIG_H)
    275267        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    276268          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     269          $(C_COMPILER_STATIC_OPTIONS) \
    277270          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    278271ports-static$(O): ports.c chicken.h $(CHICKEN_CONFIG_H)
    279272        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    280273          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     274          $(C_COMPILER_STATIC_OPTIONS) \
    281275          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    282276files-static$(O): files.c chicken.h $(CHICKEN_CONFIG_H)
    283277        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    284278          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     279          $(C_COMPILER_STATIC_OPTIONS) \
    285280          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    286281extras-static$(O): extras.c chicken.h $(CHICKEN_CONFIG_H)
    287282        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    288283          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     284          $(C_COMPILER_STATIC_OPTIONS) \
    289285          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    290286library-static$(O): library.c chicken.h $(CHICKEN_CONFIG_H)
    291287        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    292288          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     289          $(C_COMPILER_STATIC_OPTIONS) \
    293290          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    294291lolevel-static$(O): lolevel.c chicken.h $(CHICKEN_CONFIG_H)
    295292        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    296293          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
    297           $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    298 match-static$(O): match.c chicken.h $(CHICKEN_CONFIG_H)
    299         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    300           $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     294          $(C_COMPILER_STATIC_OPTIONS) \
    301295          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    302296posixunix-static$(O): posixunix.c chicken.h $(CHICKEN_CONFIG_H)
    303297        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    304298          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     299          $(C_COMPILER_STATIC_OPTIONS) \
    305300          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    306301posixwin-static$(O): posixwin.c chicken.h $(CHICKEN_CONFIG_H)
    307302        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    308303          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     304          $(C_COMPILER_STATIC_OPTIONS) \
    309305          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    310306profiler-static$(O): profiler.c chicken.h $(CHICKEN_CONFIG_H)
    311307        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    312308          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     309          $(C_COMPILER_STATIC_OPTIONS) \
    313310          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    314311regex-static$(O): regex.c chicken.h $(CHICKEN_CONFIG_H)
    315         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(PCRE_INCLUDES) \
    316           $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
    317           $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $(C_COMPILER_PCRE_OPTIONS) $< $(C_COMPILER_OUTPUT)
     312        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) \
     313          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     314          $(C_COMPILER_STATIC_OPTIONS) \
     315          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    318316scheduler-static$(O): scheduler.c chicken.h $(CHICKEN_CONFIG_H)
    319317        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    320318          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     319          $(C_COMPILER_STATIC_OPTIONS) \
    321320          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    322321srfi-1-static$(O): srfi-1.c chicken.h $(CHICKEN_CONFIG_H)
    323322        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    324323          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     324          $(C_COMPILER_STATIC_OPTIONS) \
    325325          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    326326srfi-13-static$(O): srfi-13.c chicken.h $(CHICKEN_CONFIG_H)
    327327        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    328328          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     329          $(C_COMPILER_STATIC_OPTIONS) \
    329330          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    330331srfi-14-static$(O): srfi-14.c chicken.h $(CHICKEN_CONFIG_H)
    331332        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    332333          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     334          $(C_COMPILER_STATIC_OPTIONS) \
    333335          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    334336srfi-18-static$(O): srfi-18.c chicken.h $(CHICKEN_CONFIG_H)
    335337        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    336338          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     339          $(C_COMPILER_STATIC_OPTIONS) \
    337340          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    338341srfi-69-static$(O): srfi-69.c chicken.h $(CHICKEN_CONFIG_H)
    339342        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    340343          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     344          $(C_COMPILER_STATIC_OPTIONS) \
    341345          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    342346srfi-4-static$(O): srfi-4.c chicken.h $(CHICKEN_CONFIG_H)
    343347        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    344348          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     349          $(C_COMPILER_STATIC_OPTIONS) \
    345350          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    346351stub-static$(O): stub.c chicken.h $(CHICKEN_CONFIG_H)
    347352        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    348353          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     354          $(C_COMPILER_STATIC_OPTIONS) \
    349355          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    350356tcp-static$(O): tcp.c chicken.h $(CHICKEN_CONFIG_H)
    351357        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    352358          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     359          $(C_COMPILER_STATIC_OPTIONS) \
    353360          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    354361utils-static$(O): utils.c chicken.h $(CHICKEN_CONFIG_H)
    355362        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    356363          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     364          $(C_COMPILER_STATIC_OPTIONS) \
    357365          $(C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    358366
     
    360368        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    361369          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     370          $(C_COMPILER_STATIC_OPTIONS) \
    362371          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    363372ueval-static$(O): ueval.c chicken.h $(CHICKEN_CONFIG_H)
    364373        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    365374          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     375          $(C_COMPILER_STATIC_OPTIONS) \
    366376          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    367377udata-structures-static$(O): udata-structures.c chicken.h $(CHICKEN_CONFIG_H)
    368378        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    369379          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     380          $(C_COMPILER_STATIC_OPTIONS) \
    370381          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    371382uports-static$(O): uports.c chicken.h $(CHICKEN_CONFIG_H)
    372383        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    373384          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     385          $(C_COMPILER_STATIC_OPTIONS) \
    374386          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    375387ufiles-static$(O): ufiles.c chicken.h $(CHICKEN_CONFIG_H)
    376388        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    377389          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     390          $(C_COMPILER_STATIC_OPTIONS) \
    378391          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    379392uextras-static$(O): uextras.c chicken.h $(CHICKEN_CONFIG_H)
    380393        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    381394          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     395          $(C_COMPILER_STATIC_OPTIONS) \
    382396          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    383397ulibrary-static$(O): ulibrary.c chicken.h $(CHICKEN_CONFIG_H)
    384398        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    385399          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     400          $(C_COMPILER_STATIC_OPTIONS) \
    386401          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    387402ulolevel-static$(O): ulolevel.c chicken.h $(CHICKEN_CONFIG_H)
    388403        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    389404          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     405          $(C_COMPILER_STATIC_OPTIONS) \
    390406          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    391407uposixunix-static$(O): uposixunix.c chicken.h $(CHICKEN_CONFIG_H)
    392408        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    393409          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     410          $(C_COMPILER_STATIC_OPTIONS) \
    394411          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    395412uposixwin-static$(O): uposixwin.c chicken.h $(CHICKEN_CONFIG_H)
    396413        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    397414          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     415          $(C_COMPILER_STATIC_OPTIONS) \
    398416          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    399417uregex-static$(O): uregex.c chicken.h $(CHICKEN_CONFIG_H)
    400418        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    401           $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $(PCRE_INCLUDES) \
    402           $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $(C_COMPILER_PCRE_OPTIONS) $< $(C_COMPILER_OUTPUT)
     419          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     420          $(C_COMPILER_STATIC_OPTIONS) \
     421          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    403422usrfi-1-static$(O): usrfi-1.c chicken.h $(CHICKEN_CONFIG_H)
    404423        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    405424          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     425          $(C_COMPILER_STATIC_OPTIONS) \
    406426          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    407427usrfi-13-static$(O): usrfi-13.c chicken.h $(CHICKEN_CONFIG_H)
    408428        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    409429          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     430          $(C_COMPILER_STATIC_OPTIONS) \
    410431          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    411432usrfi-14-static$(O): usrfi-14.c chicken.h $(CHICKEN_CONFIG_H)
    412433        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    413434          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     435          $(C_COMPILER_STATIC_OPTIONS) \
    414436          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    415437usrfi-18-static$(O): usrfi-18.c chicken.h $(CHICKEN_CONFIG_H)
    416438        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    417439          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     440          $(C_COMPILER_STATIC_OPTIONS) \
    418441          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    419442usrfi-69-static$(O): usrfi-69.c chicken.h $(CHICKEN_CONFIG_H)
    420443        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    421444          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     445          $(C_COMPILER_STATIC_OPTIONS) \
    422446          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    423447usrfi-4-static$(O): usrfi-4.c chicken.h $(CHICKEN_CONFIG_H)
    424448        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    425449          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     450          $(C_COMPILER_STATIC_OPTIONS) \
    426451          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    427452utcp-static$(O): utcp.c chicken.h $(CHICKEN_CONFIG_H)
    428453        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    429454          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
     455          $(C_COMPILER_STATIC_OPTIONS) \
    430456          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
    431457uutils-static$(O): uutils.c chicken.h $(CHICKEN_CONFIG_H)
    432458        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    433459          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) \
    434           $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     460          $(C_COMPILER_STATIC_OPTIONS) \
     461          $(C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS) $< $(C_COMPILER_OUTPUT)
     462
     463# import library objects
     464
     465scheme.import$(O): scheme.import.c chicken.h $(CHICKEN_CONFIG_H)
     466        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(HOST_INCLUDES) -DC_SHARED \
     467          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     468          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     469csi.import$(O): csi.import.c chicken.h $(CHICKEN_CONFIG_H)
     470        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     471          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     472          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     473chicken.import$(O): chicken.import.c chicken.h $(CHICKEN_CONFIG_H)
     474        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     475          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     476          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     477lolevel.import$(O): lolevel.import.c chicken.h $(CHICKEN_CONFIG_H)
     478        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     479          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     480          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     481srfi-1.import$(O): srfi-1.import.c chicken.h $(CHICKEN_CONFIG_H)
     482        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     483          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     484          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     485srfi-4.import$(O): srfi-4.import.c chicken.h $(CHICKEN_CONFIG_H)
     486        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     487          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     488          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     489data-structures.import$(O): data-structures.import.c chicken.h $(CHICKEN_CONFIG_H)
     490        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     491          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     492          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     493ports.import$(O): ports.import.c chicken.h $(CHICKEN_CONFIG_H)
     494        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     495          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     496          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     497files.import$(O): files.import.c chicken.h $(CHICKEN_CONFIG_H)
     498        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     499          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     500          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     501posix.import$(O): posix.import.c chicken.h $(CHICKEN_CONFIG_H)
     502        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     503          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     504          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     505srfi-13.import$(O): srfi-13.import.c chicken.h $(CHICKEN_CONFIG_H)
     506        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     507          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     508          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     509srfi-69.import$(O): srfi-69.import.c chicken.h $(CHICKEN_CONFIG_H)
     510        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     511          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     512          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     513extras.import$(O): extras.import.c chicken.h $(CHICKEN_CONFIG_H)
     514        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     515          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     516          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     517regex.import$(O): regex.import.c chicken.h $(CHICKEN_CONFIG_H)
     518        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     519          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     520          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     521irregex.import$(O): irregex.import.c chicken.h $(CHICKEN_CONFIG_H)
     522        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     523          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     524          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     525srfi-14.import$(O): srfi-14.import.c chicken.h $(CHICKEN_CONFIG_H)
     526        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     527          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     528          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     529tcp.import$(O): tcp.import.c chicken.h $(CHICKEN_CONFIG_H)
     530        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     531          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     532          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     533foreign.import$(O): foreign.import.c chicken.h $(CHICKEN_CONFIG_H)
     534        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     535          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     536          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     537compiler.import$(O): compiler.import.c chicken.h $(CHICKEN_CONFIG_H)
     538        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     539          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     540          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     541srfi-18.import$(O): srfi-18.import.c chicken.h $(CHICKEN_CONFIG_H)
     542        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     543          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     544          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     545utils.import$(O): utils.import.c chicken.h $(CHICKEN_CONFIG_H)
     546        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     547          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     548          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     549setup-api.import$(O): setup-api.import.c chicken.h $(CHICKEN_CONFIG_H)
     550        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     551          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     552          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     553setup-download.import$(O): setup-download.import.c chicken.h $(CHICKEN_CONFIG_H)
     554        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     555          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     556          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     557
     558# setup extension objects
     559setup-api$(O): setup-api.c chicken.h $(CHICKEN_CONFIG_H)
     560        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     561          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     562          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
     563setup-download$(O): setup-download.c chicken.h $(CHICKEN_CONFIG_H)
     564        $(HOST_C_COMPILER) $(HOST_C_COMPILER_OPTIONS) $(HOST_C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) -DC_SHARED \
     565          $(HOST_C_COMPILER_COMPILE_OPTION) $(HOST_C_COMPILER_OPTIMIZATION_OPTIONS) $(HOST_C_COMPILER_SHARED_OPTIONS) \
     566          $(HOST_C_COMPILER_BUILD_RUNTIME_OPTIONS) $< $(HOST_C_COMPILER_OUTPUT)
    435567
    436568# compiler objects
     
    469601batch-driver-static$(O): batch-driver.c chicken.h $(CHICKEN_CONFIG_H)
    470602        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     603          $(C_COMPILER_STATIC_OPTIONS) \
    471604          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    472605c-backend-static$(O): c-backend.c chicken.h $(CHICKEN_CONFIG_H)
    473606        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     607          $(C_COMPILER_STATIC_OPTIONS) \
    474608          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    475609c-platform-static$(O): c-platform.c chicken.h $(CHICKEN_CONFIG_H)
    476610        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     611          $(C_COMPILER_STATIC_OPTIONS) \
    477612          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    478613chicken-static$(O): chicken.c chicken.h $(CHICKEN_CONFIG_H)
    479614        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     615          $(C_COMPILER_STATIC_OPTIONS) \
    480616          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    481617compiler-static$(O): compiler.c chicken.h $(CHICKEN_CONFIG_H)
    482618        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     619          $(C_COMPILER_STATIC_OPTIONS) \
    483620          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    484621support-static$(O): support.c chicken.h $(CHICKEN_CONFIG_H)
    485622        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     623          $(C_COMPILER_STATIC_OPTIONS) \
    486624          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    487625optimizer-static$(O): optimizer.c chicken.h $(CHICKEN_CONFIG_H)
    488626        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    489           $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    490 
    491 # pcre objects
    492 
    493 $(PCRE_DIR)pcre_compile$(O): pcre_compile.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    494         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    495           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    496           $(C_COMPILER_PCRE_OPTIONS)
    497 $(PCRE_DIR)pcre_config$(O): pcre_config.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    498         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    499           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    500           $(C_COMPILER_PCRE_OPTIONS)
    501 $(PCRE_DIR)pcre_dfa_exec$(O): pcre_dfa_exec.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    502         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    503           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    504           $(C_COMPILER_PCRE_OPTIONS)
    505 $(PCRE_DIR)pcre_exec$(O): pcre_exec.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    506         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    507           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    508           $(C_COMPILER_PCRE_OPTIONS)
    509 $(PCRE_DIR)pcre_fullinfo$(O): pcre_fullinfo.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    510         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    511           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    512           $(C_COMPILER_PCRE_OPTIONS)
    513 $(PCRE_DIR)pcre_get$(O): pcre_get.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    514         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    515           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    516           $(C_COMPILER_PCRE_OPTIONS)
    517 $(PCRE_DIR)pcre_globals$(O): pcre_globals.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    518         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    519           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    520           $(C_COMPILER_PCRE_OPTIONS)
    521 $(PCRE_DIR)pcre_info$(O): pcre_info.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    522         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    523           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    524           $(C_COMPILER_PCRE_OPTIONS)
    525 $(PCRE_DIR)pcre_maketables$(O): pcre_maketables.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    526         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    527           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    528           $(C_COMPILER_PCRE_OPTIONS)
    529 $(PCRE_DIR)pcre_newline$(O): pcre_newline.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    530         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    531           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    532           $(C_COMPILER_PCRE_OPTIONS)
    533 $(PCRE_DIR)pcre_ord2utf8$(O): pcre_ord2utf8.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    534         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    535           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    536           $(C_COMPILER_PCRE_OPTIONS)
    537 $(PCRE_DIR)pcre_refcount$(O): pcre_refcount.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    538         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    539           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    540           $(C_COMPILER_PCRE_OPTIONS)
    541 $(PCRE_DIR)pcre_study$(O): pcre_study.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    542         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    543           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    544           $(C_COMPILER_PCRE_OPTIONS)
    545 $(PCRE_DIR)pcre_tables$(O): pcre_tables.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    546         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    547           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    548           $(C_COMPILER_PCRE_OPTIONS)
    549 $(PCRE_DIR)pcre_try_flipped$(O): pcre_try_flipped.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    550         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    551           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    552           $(C_COMPILER_PCRE_OPTIONS)
    553 $(PCRE_DIR)pcre_ucp_searchfuncs$(O): pcre_ucp_searchfuncs.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h ucptable.h ucpinternal.h
    554         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    555           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    556           $(C_COMPILER_PCRE_OPTIONS)
    557 $(PCRE_DIR)pcre_valid_utf8$(O): pcre_valid_utf8.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    558         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    559           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    560           $(C_COMPILER_PCRE_OPTIONS)
    561 $(PCRE_DIR)pcre_version$(O): pcre_version.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    562         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    563           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    564           $(C_COMPILER_PCRE_OPTIONS)
    565 $(PCRE_DIR)pcre_xclass$(O): pcre_xclass.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    566         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    567           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    568           $(C_COMPILER_PCRE_OPTIONS)
    569 $(PCRE_DIR)pcre_chartables$(O): pcre_chartables.c pcre_internal.h config.h $(CHICKEN_CONFIG_H)
    570         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    571           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    572           $(C_COMPILER_PCRE_OPTIONS)
    573 
    574 # static pcre objects
    575 
    576 $(PCRE_DIR)pcre_compile-static$(O): pcre_compile.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    577         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    578           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    579           $(C_COMPILER_PCRE_OPTIONS)
    580 $(PCRE_DIR)pcre_config-static$(O): pcre_config.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    581         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    582           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    583           $(C_COMPILER_PCRE_OPTIONS)
    584 $(PCRE_DIR)pcre_dfa_exec-static$(O): pcre_dfa_exec.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    585         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    586           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    587           $(C_COMPILER_PCRE_OPTIONS)
    588 $(PCRE_DIR)pcre_exec-static$(O): pcre_exec.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    589         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    590           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    591           $(C_COMPILER_PCRE_OPTIONS)
    592 $(PCRE_DIR)pcre_fullinfo-static$(O): pcre_fullinfo.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    593         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    594           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    595           $(C_COMPILER_PCRE_OPTIONS)
    596 $(PCRE_DIR)pcre_get-static$(O): pcre_get.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    597         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    598           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    599           $(C_COMPILER_PCRE_OPTIONS)
    600 $(PCRE_DIR)pcre_globals-static$(O): pcre_globals.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    601         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    602           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    603           $(C_COMPILER_PCRE_OPTIONS)
    604 $(PCRE_DIR)pcre_info-static$(O): pcre_info.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    605         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    606           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    607           $(C_COMPILER_PCRE_OPTIONS)
    608 $(PCRE_DIR)pcre_maketables-static$(O): pcre_maketables.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    609         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    610           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    611           $(C_COMPILER_PCRE_OPTIONS)
    612 $(PCRE_DIR)pcre_newline-static$(O): pcre_newline.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    613         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    614           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    615           $(C_COMPILER_PCRE_OPTIONS)
    616 $(PCRE_DIR)pcre_ord2utf8-static$(O): pcre_ord2utf8.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    617         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    618           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    619           $(C_COMPILER_PCRE_OPTIONS)
    620 $(PCRE_DIR)pcre_refcount-static$(O): pcre_refcount.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    621         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    622           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    623           $(C_COMPILER_PCRE_OPTIONS)
    624 $(PCRE_DIR)pcre_study-static$(O): pcre_study.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    625         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    626           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    627           $(C_COMPILER_PCRE_OPTIONS)
    628 $(PCRE_DIR)pcre_tables-static$(O): pcre_tables.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    629         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    630           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    631           $(C_COMPILER_PCRE_OPTIONS)
    632 $(PCRE_DIR)pcre_try_flipped-static$(O): pcre_try_flipped.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    633         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    634           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    635           $(C_COMPILER_PCRE_OPTIONS)
    636 $(PCRE_DIR)pcre_ucp_searchfuncs-static$(O): pcre_ucp_searchfuncs.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h ucptable.h ucpinternal.h
    637         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    638           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    639           $(C_COMPILER_PCRE_OPTIONS)
    640 $(PCRE_DIR)pcre_valid_utf8-static$(O): pcre_valid_utf8.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    641         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    642           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    643           $(C_COMPILER_PCRE_OPTIONS)
    644 $(PCRE_DIR)pcre_version-static$(O): pcre_version.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    645         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    646           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    647           $(C_COMPILER_PCRE_OPTIONS)
    648 $(PCRE_DIR)pcre_xclass-static$(O): pcre_xclass.c pcre_internal.h config.h $(CHICKEN_CONFIG_H) pcre.h ucp.h
    649         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    650           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    651           $(C_COMPILER_PCRE_OPTIONS)
    652 $(PCRE_DIR)pcre_chartables-static$(O): pcre_chartables.c pcre_internal.h config.h $(CHICKEN_CONFIG_H)
    653         $(C_COMPILER) $(C_COMPILER_OPTIONS) $(PCRE_INCLUDES) $(C_COMPILER_COMPILE_OPTION) \
    654           $(C_COMPILER_OPTIMIZATION_OPTIONS) $(C_COMPILER_SHARED_OPTIONS) $< $(C_COMPILER_OUTPUT) \
    655           $(C_COMPILER_PCRE_OPTIONS)
     627          $(C_COMPILER_STATIC_OPTIONS) \
     628          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    656629
    657630# assembler objects
     
    667640        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) $(C_COMPILER_SHARED_OPTIONS) \
    668641          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    669 chicken-setup$(O): chicken-setup.c chicken.h $(CHICKEN_CONFIG_H)
     642chicken-install$(O): chicken-install.c chicken.h $(CHICKEN_CONFIG_H)
     643        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) $(C_COMPILER_SHARED_OPTIONS) \
     644          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
     645chicken-uninstall$(O): chicken-uninstall.c chicken.h $(CHICKEN_CONFIG_H)
     646        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) $(C_COMPILER_SHARED_OPTIONS) \
     647          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
     648chicken-status$(O): chicken-status.c chicken.h $(CHICKEN_CONFIG_H)
    670649        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) $(C_COMPILER_SHARED_OPTIONS) \
    671650          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
     
    681660csi-static$(O): csi.c chicken.h $(CHICKEN_CONFIG_H)
    682661        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
     662          $(C_COMPILER_STATIC_OPTIONS) \
    683663          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    684664chicken-bug$(O): chicken-bug.c chicken.h $(CHICKEN_CONFIG_H)
    685665        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    686           $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
    687 
    688 # libchicken
     666          $(C_COMPILER_STATIC_OPTIONS) \
     667          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT)
     668
     669# libraries
    689670
    690671.PHONY: libs
     
    692673libs: $(TARGETLIBS)
    693674
    694 libchicken$(SO)$(SONAME_VERSION): $(LIBCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
     675libchicken$(SO)$(SONAME_VERSION): $(LIBCHICKEN_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
    695676        $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_LINKER_OPTIONS) \
    696677          $(LINKER_OUTPUT) $^ $(LIBCHICKEN_SO_LIBRARIES)
    697 ifdef SONAME_VERSION
     678ifneq ($(SONAME_VERSION),)
    698679        ln -sf $(LIBCHICKEN_SO_FILE) libchicken$(SO)
    699680endif
    700681
    701682
    702 libuchicken$(SO)$(SONAME_VERSION): $(LIBUCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
     683libuchicken$(SO)$(SONAME_VERSION): $(LIBUCHICKEN_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
    703684        $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBUCHICKEN_SO_LINKER_OPTIONS) \
    704685          $(LINKER_OUTPUT) $^ $(LIBUCHICKEN_SO_LIBRARIES)
    705 ifdef SONAME_VERSION
     686ifneq ($(SONAME_VERSION),)
    706687        ln -sf $(LIBUCHICKEN_SO_FILE) libuchicken$(SO)
    707688endif
    708689
    709 cygchicken-0.dll: $(LIBCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
     690cygchicken-0.dll: $(LIBCHICKEN_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
    710691        gcc -shared -o $(LIBCHICKEN_SO_FILE) -Wl,--dll -Wl,--add-stdcall-alias \
    711692            -Wl,--enable-stdcall-fixup -Wl,--warn-unresolved-symbols \
     
    714695            -Wl,--out-implib=libchicken.dll.a -Wl,--export-all-symbols \
    715696            -Wl,--enable-auto-import \
    716             -Wl,--whole-archive $(LIBCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT) \
     697            -Wl,--whole-archive $(LIBCHICKEN_SHARED_OBJECTS) $(APPLY_HACK_OBJECT) \
    717698            -Wl,--no-whole-archive $(LIBCHICKEN_SO_LIBRARIES)
    718699
    719 cyguchicken-0.dll: $(LIBUCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
     700cyguchicken-0.dll: $(LIBUCHICKEN_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
    720701        gcc -shared -o $(LIBUCHICKEN_SO_FILE) -Wl,--dll -Wl,--add-stdcall-alias \
    721702            -Wl,--enable-stdcall-fixup -Wl,--warn-unresolved-symbols \
     
    724705            -Wl,--out-implib=libuchicken.dll.a -Wl,--export-all-symbols \
    725706            -Wl,--enable-auto-import \
    726             -Wl,--whole-archive $(LIBUCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT) \
     707            -Wl,--whole-archive $(LIBUCHICKEN_SHARED_OBJECTS) $(APPLY_HACK_OBJECT) \
    727708            -Wl,--no-whole-archive $(LIBUCHICKEN_SO_LIBRARIES)
    728709
    729710
    730 libchickengui$(SO): $(APPLY_HACK_OBJECT) $(LIBCHICKENGUI_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS)
     711libchickengui$(SO): $(APPLY_HACK_OBJECT) $(LIBCHICKENGUI_SHARED_OBJECTS)
    731712        $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBCHICKENGUI_SO_LINKER_OPTIONS) \
    732713        $(LINKER_OUTPUT) $^ $(LIBCHICKENGUI_SO_LIBRARIES)
    733714
    734 libchicken$(A): $(APPLY_HACK_OBJECT) $(LIBCHICKEN_STATIC_OBJECTS) $(PCRE_STATIC_OBJECTS)
     715libchicken$(A): $(APPLY_HACK_OBJECT) $(LIBCHICKEN_STATIC_OBJECTS)
    735716        $(LIBRARIAN) $(LIBRARIAN_OPTIONS) $(LIBRARIAN_OUTPUT) $^
    736717
    737 libuchicken$(A): $(APPLY_HACK_OBJECT) $(LIBUCHICKEN_STATIC_OBJECTS) $(PCRE_STATIC_OBJECTS)
     718libuchicken$(A): $(APPLY_HACK_OBJECT) $(LIBUCHICKEN_STATIC_OBJECTS)
    738719        $(LIBRARIAN) $(LIBRARIAN_OPTIONS) $(LIBRARIAN_OUTPUT) $^
    739720
    740 libchickengui$(A): $(APPLY_HACK_OBJECT) $(LIBCHICKENGUI_STATIC_OBJECTS) $(PCRE_STATIC_OBJECTS)
     721libchickengui$(A): $(APPLY_HACK_OBJECT) $(LIBCHICKENGUI_STATIC_OBJECTS)
    741722        $(LIBRARIAN) $(LIBRARIAN_OPTIONS) $(LIBRARIAN_OUTPUT) $^
     723
     724# import libraries and extensions
     725
     726.SUFFIXES: .so
     727
     728%.so: %.o
     729        $(HOST_LINKER) $(HOST_LINKER_OPTIONS) $(HOST_LINKER_LINK_SHARED_DLOADABLE_OPTIONS) $^ $(HOST_LINKER_OUTPUT_OPTION) $@ \
     730          $(HOST_LINKER_LIBRARY_PREFIX)chicken$(HOST_LINKER_LIBRARY_SUFFIX) \
     731          $(HOST_LIBRARIES)
    742732
    743733# executables
     
    751741          $(LINKER_LIBRARY_PREFIX)chicken$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
    752742
    753 $(CHICKEN_SETUP_PROGRAM)$(EXE): chicken-setup$(O) $(PRIMARY_LIBCHICKEN)
     743$(CHICKEN_INSTALL_PROGRAM)$(EXE): chicken-install$(O) $(PRIMARY_LIBCHICKEN)
     744        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT) \
     745          $(LINKER_LIBRARY_PREFIX)chicken$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     746$(CHICKEN_UNINSTALL_PROGRAM)$(EXE): chicken-uninstall$(O) $(PRIMARY_LIBCHICKEN)
     747        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT) \
     748          $(LINKER_LIBRARY_PREFIX)chicken$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     749$(CHICKEN_STATUS_PROGRAM)$(EXE): chicken-status$(O) $(PRIMARY_LIBCHICKEN)
    754750        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT) \
    755751          $(LINKER_LIBRARY_PREFIX)chicken$(LINKER_LIBRARY_SUFFIX) $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     
    778774
    779775chicken.info: chicken.texi
    780         $(MAKEINFO_PROGRAM) $(MAKEINFO_PROGRAM_OPTIONS) $<
     776        -$(MAKEINFO_PROGRAM) $(MAKEINFO_PROGRAM_OPTIONS) $<
    781777
    782778# installation
    783779
    784 .PHONY: install uninstall install-libs install-manifests
     780.PHONY: install uninstall install-libs install-manifests install-import-libs install-setup-files \
     781        install-dirs install-includes
    785782
    786783install-libs:
    787 ifneq ($(DESTDIR),)
    788         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)
    789 endif
    790         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(ILIBDIR)
    791         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(ICHICKENLIBDIR)
    792         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IEGGDIR)
    793         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IINCDIR)
    794         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)
    795784        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) libchicken$(A) $(DESTDIR)$(ILIBDIR)
    796785        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) libuchicken$(A) $(DESTDIR)$(ILIBDIR)
     
    826815        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBUCHICKEN_SO_FILE) $(DESTDIR)$(ILIBDIR)
    827816endif
    828 ifdef SONAME_VERSION
     817ifneq ($(SONAME_VERSION),)
    829818        cd $(DESTDIR)$(ILIBDIR)  && ln -sf $(LIBCHICKEN_SO_FILE) libchicken$(SO)
    830819        cd $(DESTDIR)$(ILIBDIR)  && ln -sf $(LIBUCHICKEN_SO_FILE) libuchicken$(SO)
     
    845834        -$(INSTALL_PROGRAM) $(INSTALL_MANIFEST_OPTIONS) $(CHICKEN_BUG_MANIFEST) $(DESTDIR)$(IBINDIR)
    846835ifndef STATICBUILD
    847         -$(INSTALL_PROGRAM) $(INSTALL_MANIFEST_OPTIONS) $(CHICKEN_SETUP_MANIFEST) $(DESTDIR)$(IBINDIR)
    848 endif
    849 endif
     836        -$(INSTALL_PROGRAM) $(INSTALL_MANIFEST_OPTIONS) $(CHICKEN_INSTALL_MANIFEST) $(DESTDIR)$(IBINDIR)
     837        -$(INSTALL_PROGRAM) $(INSTALL_MANIFEST_OPTIONS) $(CHICKEN_UNINSTALL_MANIFEST) $(DESTDIR)$(IBINDIR)
     838        -$(INSTALL_PROGRAM) $(INSTALL_MANIFEST_OPTIONS) $(CHICKEN_STATUS_MANIFEST) $(DESTDIR)$(IBINDIR)
     839endif
     840endif
     841
     842install-dirs:
     843ifneq ($(DESTDIR),)
     844        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)
     845endif
     846        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(ILIBDIR)
     847        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(ICHICKENLIBDIR)
     848        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IEGGDIR)
     849        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IDATADIR)
     850        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IINCDIR)
     851        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)
     852        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IMANDIR)
     853        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(ITOPMANDIR)
     854        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IINFODIR)
     855        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IDOCDIR)
    850856
    851857ifeq ($(NEEDS_RELINKING),yes)
     
    853859        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(CHICKEN_PROGRAM)$(EXE) \
    854860          $(CSI_PROGRAM)$(EXE) $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) \
    855           $(CHICKEN_SETUP_PROGRAM)$(EXE)
     861          $(CHICKEN_INSTALL_PROGRAM)$(EXE) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) \
     862          $(CHICKEN_STATUS_PROGRAM)$(EXE) \
     863          $(IMPORT_LIBRARIES:%=%.so) $(IMPORT_LIBRARIES:%=%.import.so)
    856864        $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) NEEDS_RELINKING=no RUNTIME_LINKER_PATH=$(LIBDIR) install
    857865        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_PROGRAM)$(EXE) $(CSI_PROGRAM)$(EXE) \
    858866          $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE)
    859867ifndef STATICBUILD
    860         $(MAKE_WRITABLE_COMMAND) $(CHICKEN_SETUP_PROGRAM)$(EXE)
     868        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_INSTALL_PROGRAM)$(EXE)
     869        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE)
     870        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_STATUS_PROGRAM)$(EXE)
    861871endif
    862872else
    863 install: $(TARGETS) install-libs install-manifests
    864 ifneq ($(DESTDIR),)
    865         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)
    866 endif
    867         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)
    868         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(ITOPMANDIR)
    869         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IMANDIR)
    870         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IINFODIR)
    871         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IDOCDIR)
     873install: $(TARGETS) install-dirs install-libs install-import-libs install-manifests \
     874         install-setup-files  install-includes
    872875        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
    873876        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CSI_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     
    881884        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CSC_PROGRAM)
    882885        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_BUG_PROGRAM)
     886        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/setup-api.so
     887        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/setup-download.so
     888        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/setup-api.import.so
     889        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/setup-download.import.so
     890        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/chicken.import.so
     891        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/lolevel.import.so
     892        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-1.import.so
     893        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-4.import.so
     894        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/data-structures.import.so
     895        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/ports.import.so
     896        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/files.import.so
     897        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/posix.import.so
     898        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-13.import.so
     899        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-69.import.so
     900        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/extras.import.so
     901        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/regex.import.so
     902        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/irregex.import.so
     903        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-14.import.so
     904        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/tcp.import.so
     905        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/foreign.import.so
     906        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/compiler.import.so
     907        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/scheme.import.so
     908        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/csi.import.so
     909        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/srfi-18.import.so
     910        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IEGGDIR)/utils.import.so
    883911endif
    884912ifndef STATICBUILD
    885         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_SETUP_PROGRAM)$(EXE) \
    886           $(DESTDIR)$(IBINDIR)
     913        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_INSTALL_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     914        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_UNINSTALL_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     915        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_STATUS_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
    887916ifneq ($(POSTINSTALL_PROGRAM),true)
    888         $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_SETUP_PROGRAM)
     917        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_INSTALL_PROGRAM)
     918        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_UNINSTALL_PROGRAM)
     919        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_STATUS_PROGRAM)
     920endif
     921ifneq ($(CROSS_CHICKEN),1)
     922ifeq ($(DESTDIR),)
     923        -$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM) -update-db
     924else
     925        @echo
     926        @echo "Warning: cannot run chicken-install -update-db when DESTDIR is set"
     927        @echo
     928endif
    889929endif
    890930endif
     
    892932        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csi.1 $(DESTDIR)$(IMANDIR)
    893933        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)csc.1 $(DESTDIR)$(IMANDIR)
    894         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-setup.1 $(DESTDIR)$(IMANDIR)
     934        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-install.1 $(DESTDIR)$(IMANDIR)
     935        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-uninstall.1 $(DESTDIR)$(IMANDIR)
     936        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-status.1 $(DESTDIR)$(IMANDIR)
    895937        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-profile.1 $(DESTDIR)$(IMANDIR)
    896938        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-bug.1 $(DESTDIR)$(IMANDIR)
    897         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IDOCDIR)/html
    898         -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)html/* $(DESTDIR)$(IDOCDIR)/html
     939        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IDOCDIR)$(SEP)html
     940        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)html$(SEP)* $(DESTDIR)$(IDOCDIR)$(SEP)html
    899941        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.pdf $(DESTDIR)$(IDOCDIR)
    900942        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)README $(DESTDIR)$(IDOCDIR)
    901943        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)LICENSE $(DESTDIR)$(IDOCDIR)
    902         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-more-macros.scm $(DESTDIR)$(IDATADIR)
    903         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-ffi-macros.scm $(DESTDIR)$(IDATADIR)
    904         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-sys-macros.scm $(DESTDIR)$(IDATADIR)
    905         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) *.exports $(DESTDIR)$(IDATADIR)
    906944        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.info $(DESTDIR)$(IINFODIR)
    907         $(INSTALLINFO_PROGRAM) $(INSTALLINFO_PROGRAM_OPTIONS) --infodir=$(DESTDIR)$(IINFODIR) chicken.info
    908 ifdef WINDOWS
     945        -$(INSTALLINFO_PROGRAM) $(INSTALLINFO_PROGRAM_OPTIONS) --infodir=$(DESTDIR)$(IINFODIR) chicken.info
     946ifdef WINDOWS_SHELL
    909947        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(SRCDIR)csibatch.bat $(DESTDIR)$(IBINDIR)
    910948endif
    911949endif
     950
     951ifdef STATICBUILD
     952# copy/xcopy is too dumb on Windows
     953install-import-libs:
     954        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) scheme.import.scm $(DESTDIR)$(IEGGDIR)
     955        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.import.scm $(DESTDIR)$(IEGGDIR)
     956        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) lolevel.import.scm $(DESTDIR)$(IEGGDIR)
     957        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-1.import.scm $(DESTDIR)$(IEGGDIR)
     958        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-4.import.scm $(DESTDIR)$(IEGGDIR)
     959        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) data-structures.import.scm $(DESTDIR)$(IEGGDIR)
     960        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) ports.import.scm $(DESTDIR)$(IEGGDIR)
     961        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) files.import.scm $(DESTDIR)$(IEGGDIR)
     962        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) posix.import.scm $(DESTDIR)$(IEGGDIR)
     963        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-13.import.scm $(DESTDIR)$(IEGGDIR)
     964        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-69.import.scm $(DESTDIR)$(IEGGDIR)
     965        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) extras.import.scm $(DESTDIR)$(IEGGDIR)
     966        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) regex.import.scm $(DESTDIR)$(IEGGDIR)
     967        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-14.import.scm $(DESTDIR)$(IEGGDIR)
     968        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) tcp.import.scm $(DESTDIR)$(IEGGDIR)
     969        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) foreign.import.scm $(DESTDIR)$(IEGGDIR)
     970        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) compiler.import.scm $(DESTDIR)$(IEGGDIR)
     971        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-18.import.scm $(DESTDIR)$(IEGGDIR)
     972        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) utils.import.scm $(DESTDIR)$(IEGGDIR)
     973        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) csi.import.scm $(DESTDIR)$(IEGGDIR)
     974        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) irregex.import.scm $(DESTDIR)$(IEGGDIR)
     975        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) setup-api.import.scm $(DESTDIR)$(IEGGDIR)
     976        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) setup-download.import.scm $(DESTDIR)$(IEGGDIR)
     977else
     978install-import-libs:
     979        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) scheme.import.so $(DESTDIR)$(IEGGDIR)
     980        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) chicken.import.so $(DESTDIR)$(IEGGDIR)
     981        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) lolevel.import.so $(DESTDIR)$(IEGGDIR)
     982        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) srfi-1.import.so $(DESTDIR)$(IEGGDIR)
     983        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) srfi-4.import.so $(DESTDIR)$(IEGGDIR)
     984        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) data-structures.import.so $(DESTDIR)$(IEGGDIR)
     985        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) ports.import.so $(DESTDIR)$(IEGGDIR)
     986        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) files.import.so $(DESTDIR)$(IEGGDIR)
     987        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) posix.import.so $(DESTDIR)$(IEGGDIR)
     988        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) srfi-13.import.so $(DESTDIR)$(IEGGDIR)
     989        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) srfi-69.import.so $(DESTDIR)$(IEGGDIR)
     990        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) extras.import.so $(DESTDIR)$(IEGGDIR)
     991        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) regex.import.so $(DESTDIR)$(IEGGDIR)
     992        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) srfi-14.import.so $(DESTDIR)$(IEGGDIR)
     993        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) tcp.import.so $(DESTDIR)$(IEGGDIR)
     994        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) foreign.import.so $(DESTDIR)$(IEGGDIR)
     995        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) compiler.import.so $(DESTDIR)$(IEGGDIR)
     996        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) srfi-18.import.so $(DESTDIR)$(IEGGDIR)
     997        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) utils.import.so $(DESTDIR)$(IEGGDIR)
     998        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) csi.import.so $(DESTDIR)$(IEGGDIR)
     999        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) irregex.import.so $(DESTDIR)$(IEGGDIR)
     1000        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) setup-api.import.so $(DESTDIR)$(IEGGDIR)
     1001        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) setup-download.import.so $(DESTDIR)$(IEGGDIR)
     1002endif
     1003
     1004install-setup-files:
     1005        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)setup.defaults $(DESTDIR)$(IDATADIR)
     1006        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) setup-api.so $(DESTDIR)$(IEGGDIR)
     1007        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) setup-download.so $(DESTDIR)$(IEGGDIR)
     1008
     1009install-includes:
     1010        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-primitive-object-inlines.scm $(DESTDIR)$(IDATADIR)
     1011        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-thread-object-inlines.scm $(DESTDIR)$(IDATADIR)
    9121012
    9131013uninstall:
    9141014        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROGRAM)$(EXE) \
    9151015          $(DESTDIR)$(IBINDIR)/$(CSI_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROFILE_PROGRAM)$(EXE) \
    916           $(DESTDIR)$(IBINDIR)/$(CHICKEN_SETUP_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)/$(CSC_PROGRAM)$(EXE) \
     1016          $(DESTDIR)$(IBINDIR)/$(CHICKEN_INSTALL_PROGRAM)$(EXE) \
     1017          $(DESTDIR)$(IBINDIR)/$(CHICKEN_UNINSTALL_PROGRAM)$(EXE) \
     1018          $(DESTDIR)$(IBINDIR)/$(CHICKEN_STATUS_PROGRAM)$(EXE) \
     1019          $(DESTDIR)$(IBINDIR)/$(CSC_PROGRAM)$(EXE) \
    9171020          $(DESTDIR)$(IBINDIR)/$(CHICKEN_BUG_PROGRAM)$(EXE)
    9181021        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(ILIBDIR)/libchicken*.* $(DESTDIR)$(ILIBDIR)/libuchicken*.* $(DESTDIR)$(IBINDIR)/libchicken*.* $(DESTDIR)$(IBINDIR)/libuchicken*.*
     
    9241027        $(DESTDIR)$(IBINDIR)/$(CSI_MANIFEST) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROFILE_MANIFEST) \
    9251028        $(DESTDIR)$(IBINDIR)/$(CSC_MANIFEST) $(DESTDIR)$(IBINDIR)/$(CHICKEN_BUG_MANIFEST) \
    926         $(DESTDIR)$(IBINDIR)/$(CHICKEN_SETUP_MANIFEST)
     1029        $(DESTDIR)$(IBINDIR)/$(CHICKEN_INSTALL_MANIFEST) \
     1030        $(DESTDIR)$(IBINDIR)/$(CHICKEN_UNINSTALL_MANIFEST) \
     1031        $(DESTDIR)$(IBINDIR)/$(CHICKEN_STATUS_MANIFEST)
    9271032endif
    9281033        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IMANDIR)/chicken.1 $(DESTDIR)$(IMANDIR)/csi.1 \
    929           $(DESTDIR)$(IMANDIR)/csc.1 $(DESTDIR)$(IMANDIR)/chicken-profile.1 $(DESTDIR)$(IMANDIR)/chicken-setup.1 \
    930           $(DESTDIR)$(IMANDIR)/chicken-bug.1
     1034          $(DESTDIR)$(IMANDIR)/csc.1 $(DESTDIR)$(IMANDIR)/chicken-profile.1 $(DESTDIR)$(IMANDIR)/chicken-install.1 \
     1035          $(DESTDIR)$(IMANDIR)/chicken-bug.1 $(DESTDIR)$(IMANDIR)/chicken-uninstall.1 \
     1036          $(DESTDIR)$(IMANDIR)/chicken-status.1
    9311037        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IINCDIR)/chicken.h $(DESTDIR)$(IINCDIR)/chicken-config.h
    9321038        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IINCDIR)/chicken.gch
    9331039        $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) $(DESTDIR)$(IDATADIR)
    9341040        $(UNINSTALLINFO_PROGRAM) $(UNINSTALLINFO_PROGRAM_OPTIONS) --infodir=$(DESTDIR)$(IINFODIR) chicken.info
    935         $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IINFODIR)/chicken.info
    936 ifdef WINDOWS
    937         $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)/csibatch.bat
     1041        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IINFODIR)$(SEP)chicken.info
     1042ifdef WINDOWS_SHELL
     1043        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)$(SEP)csibatch.bat
    9381044endif
    9391045
     
    9411047
    9421048.SUFFIXES: .scm
     1049.SECONDARY: setup-api.import.scm setup-download.import.scm
     1050
     1051setup-api.import.scm: setup-api.c
     1052setup-download.import.scm: setup-download.c
    9431053
    9441054library.c: $(SRCDIR)library.scm $(SRCDIR)version.scm $(SRCDIR)banner.scm
     
    9461056eval.c: $(SRCDIR)eval.scm
    9471057        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
     1058expand.c: $(SRCDIR)expand.scm $(SRCDIR)synrules.scm
     1059        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
     1060chicken-syntax.c: $(SRCDIR)chicken-syntax.scm
     1061        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
    9481062data-structures.c: $(SRCDIR)data-structures.scm $(SRCDIR)private-namespace.scm
    949         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
     1063        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend $(SRCDIR)private-namespace.scm
    9501064ports.c: $(SRCDIR)ports.scm $(SRCDIR)private-namespace.scm
    951         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
     1065        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend $(SRCDIR)private-namespace.scm
    9521066files.c: $(SRCDIR)files.scm $(SRCDIR)private-namespace.scm
    953         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
     1067        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend $(SRCDIR)private-namespace.scm
    9541068extras.c: $(SRCDIR)extras.scm $(SRCDIR)private-namespace.scm
    955         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
     1069        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend $(SRCDIR)private-namespace.scm
    9561070lolevel.c: $(SRCDIR)lolevel.scm
    9571071        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
     
    9691083        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
    9701084srfi-69.c: $(SRCDIR)srfi-69.scm $(SRCDIR)private-namespace.scm
    971         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
     1085        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend $(SRCDIR)private-namespace.scm
    9721086utils.c: $(SRCDIR)utils.scm
    9731087        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
     
    9761090posixwin.c: $(SRCDIR)posixwin.scm
    9771091        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
    978 regex.c: $(SRCDIR)regex.scm
    979         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_PCRE_LIBRARY_OPTIONS) -output-file $@
     1092regex.c: $(SRCDIR)regex.scm $(SRCDIR)irregex.scm
     1093        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
    9801094scheduler.c: $(SRCDIR)scheduler.scm
    9811095        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
     
    9841098stub.c: $(SRCDIR)stub.scm
    9851099        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
    986 match.c: $(SRCDIR)match.scm
    987         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
    988 
    989 ulibrary.c: $(SRCDIR)library.scm $(SRCDIR)version.scm $(SRCDIR)banner.scm
     1100
     1101ulibrary.c: $(SRCDIR)library.scm $(SRCDIR)version.scm $(SRCDIR)banner.scm $(SRCDIR)unsafe-declarations.scm
    9901102        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    991 ueval.c: $(SRCDIR)eval.scm
     1103ueval.c: $(SRCDIR)eval.scm $(SRCDIR)unsafe-declarations.scm
    9921104        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    993 udata-structures.c: $(SRCDIR)data-structures.scm $(SRCDIR)private-namespace.scm
    994         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend private-namespace.scm
    995 uports.c: $(SRCDIR)ports.scm $(SRCDIR)private-namespace.scm
    996         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend private-namespace.scm
    997 ufiles.c: $(SRCDIR)files.scm $(SRCDIR)private-namespace.scm
    998         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend private-namespace.scm
    999 uextras.c: $(SRCDIR)extras.scm $(SRCDIR)private-namespace.scm
    1000         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend private-namespace.scm
    1001 ulolevel.c: $(SRCDIR)lolevel.scm
     1105udata-structures.c: $(SRCDIR)data-structures.scm $(SRCDIR)private-namespace.scm $(SRCDIR)unsafe-declarations.scm
     1106        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend $(SRCDIR)private-namespace.scm
     1107uports.c: $(SRCDIR)ports.scm $(SRCDIR)private-namespace.scm $(SRCDIR)unsafe-declarations.scm
     1108        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
     1109ufiles.c: $(SRCDIR)files.scm $(SRCDIR)private-namespace.scm $(SRCDIR)unsafe-declarations.scm
     1110        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
     1111uextras.c: $(SRCDIR)extras.scm $(SRCDIR)private-namespace.scm $(SRCDIR)unsafe-declarations.scm
     1112        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend $(SRCDIR)private-namespace.scm
     1113ulolevel.c: $(SRCDIR)lolevel.scm $(SRCDIR)unsafe-declarations.scm
    10021114        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1003 utcp.c: $(SRCDIR)tcp.scm
     1115utcp.c: $(SRCDIR)tcp.scm $(SRCDIR)unsafe-declarations.scm
    10041116        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1005 usrfi-1.c: $(SRCDIR)srfi-1.scm
     1117usrfi-1.c: $(SRCDIR)srfi-1.scm $(SRCDIR)unsafe-declarations.scm
    10061118        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1007 usrfi-4.c: $(SRCDIR)srfi-4.scm
     1119usrfi-4.c: $(SRCDIR)srfi-4.scm $(SRCDIR)unsafe-declarations.scm
    10081120        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1009 usrfi-13.c: $(SRCDIR)srfi-13.scm
     1121usrfi-13.c: $(SRCDIR)srfi-13.scm $(SRCDIR)unsafe-declarations.scm
    10101122        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1011 usrfi-14.c: $(SRCDIR)srfi-14.scm
     1123usrfi-14.c: $(SRCDIR)srfi-14.scm $(SRCDIR)unsafe-declarations.scm
    10121124        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1013 usrfi-18.c: $(SRCDIR)srfi-18.scm
     1125usrfi-18.c: $(SRCDIR)srfi-18.scm $(SRCDIR)unsafe-declarations.scm
    10141126        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1015 usrfi-69.c: $(SRCDIR)srfi-69.scm $(SRCDIR)private-namespace.scm
    1016         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend private-namespace.scm
     1127usrfi-69.c: $(SRCDIR)srfi-69.scm $(SRCDIR)private-namespace.scm $(SRCDIR)unsafe-declarations.scm
     1128        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend $(SRCDIR)private-namespace.scm
    10171129uutils.c: $(SRCDIR)utils.scm
    10181130        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1019 uposixunix.c: $(SRCDIR)posixunix.scm
     1131uposixunix.c: $(SRCDIR)posixunix.scm $(SRCDIR)unsafe-declarations.scm
    10201132        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1021 uposixwin.c: $(SRCDIR)posixwin.scm
     1133uposixwin.c: $(SRCDIR)posixwin.scm $(SRCDIR)unsafe-declarations.scm
    10221134        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1023 uregex.c: $(SRCDIR)regex.scm
    1024         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_PCRE_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    1025 
    1026 chicken.c: $(SRCDIR)chicken.scm $(SRCDIR)chicken-more-macros.scm $(SRCDIR)chicken-ffi-macros.scm $(SRCDIR)private-namespace.scm
     1135uregex.c: $(SRCDIR)regex.scm $(SRCDIR)irregex.scm $(SRCDIR)unsafe-declarations.scm
     1136        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
     1137
     1138chicken.import.c: $(SRCDIR)chicken.import.scm
     1139        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1140lolevel.import.c: $(SRCDIR)lolevel.import.scm
     1141        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1142srfi-1.import.c: $(SRCDIR)srfi-1.import.scm
     1143        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1144srfi-4.import.c: $(SRCDIR)srfi-4.import.scm
     1145        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1146data-structures.import.c: $(SRCDIR)data-structures.import.scm
     1147        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1148ports.import.c: $(SRCDIR)ports.import.scm
     1149        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1150files.import.c: $(SRCDIR)files.import.scm
     1151        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1152posix.import.c: $(SRCDIR)posix.import.scm
     1153        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1154srfi-13.import.c: $(SRCDIR)srfi-13.import.scm
     1155        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1156srfi-69.import.c: $(SRCDIR)srfi-69.import.scm
     1157        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1158extras.import.c: $(SRCDIR)extras.import.scm
     1159        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1160regex.import.c: $(SRCDIR)regex.import.scm
     1161        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1162irregex.import.c: $(SRCDIR)irregex.import.scm
     1163        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1164srfi-14.import.c: $(SRCDIR)srfi-14.import.scm
     1165        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1166tcp.import.c: $(SRCDIR)tcp.import.scm
     1167        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1168foreign.import.c: $(SRCDIR)foreign.import.scm
     1169        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1170compiler.import.c: $(SRCDIR)compiler.import.scm
     1171        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1172scheme.import.c: $(SRCDIR)scheme.import.scm
     1173        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1174csi.import.c: $(SRCDIR)csi.import.scm
     1175        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1176srfi-18.import.c: $(SRCDIR)srfi-18.import.scm
     1177        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1178utils.import.c: $(SRCDIR)utils.import.scm
     1179        $(CHICKEN) $< $(CHICKEN_IMPORT_LIBRARY_OPTIONS) -output-file $@
     1180setup-api.import.c: $(SRCDIR)setup-api.scm
     1181        $(CHICKEN) $(SRCDIR)setup-api.import.scm $(CHICKEN_IMPORT_LIBRARY_OPTIONS) \
     1182          -ignore-repository -output-file $@
     1183setup-download.import.c: $(SRCDIR)setup-download.scm
     1184        $(CHICKEN) $(SRCDIR)setup-download.import.scm $(CHICKEN_IMPORT_LIBRARY_OPTIONS) \
     1185          -ignore-repository -output-file $@
     1186
     1187chicken.c: $(SRCDIR)chicken.scm $(SRCDIR)chicken-ffi-syntax.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    10271188        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1028 support.c: $(SRCDIR)support.scm $(SRCDIR)banner.scm $(SRCDIR)private-namespace.scm
     1189support.c: $(SRCDIR)support.scm $(SRCDIR)banner.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    10291190        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1030 compiler.c: $(SRCDIR)compiler.scm $(SRCDIR)private-namespace.scm
     1191compiler.c: $(SRCDIR)compiler.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    10311192        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1032 optimizer.c: $(SRCDIR)optimizer.scm $(SRCDIR)private-namespace.scm
     1193optimizer.c: $(SRCDIR)optimizer.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    10331194        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1034 batch-driver.c: $(SRCDIR)batch-driver.scm $(SRCDIR)private-namespace.scm
     1195batch-driver.c: $(SRCDIR)batch-driver.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    10351196        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1036 c-platform.c: $(SRCDIR)c-platform.scm $(SRCDIR)private-namespace.scm
     1197c-platform.c: $(SRCDIR)c-platform.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    10371198        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    1038 c-backend.c: $(SRCDIR)c-backend.scm $(SRCDIR)private-namespace.scm
     1199c-backend.c: $(SRCDIR)c-backend.scm $(SRCDIR)private-namespace.scm $(SRCDIR)tweaks.scm
    10391200        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
    10401201
    1041 csi.c: $(SRCDIR)csi.scm $(SRCDIR)banner.scm $(SRCDIR)chicken-more-macros.scm $(SRCDIR)private-namespace.scm
    1042         $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@ -extend private-namespace.scm
     1202csi.c: $(SRCDIR)csi.scm $(SRCDIR)banner.scm $(SRCDIR)private-namespace.scm
     1203        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@ -extend $(SRCDIR)private-namespace.scm
    10431204chicken-profile.c: $(SRCDIR)chicken-profile.scm
    10441205        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    1045 chicken-setup.c: $(SRCDIR)chicken-setup.scm $(SRCDIR)chicken-more-macros.scm
    1046         $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
     1206chicken-install.c: $(SRCDIR)chicken-install.scm setup-download.import.scm
     1207        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -ignore-repository -output-file $@
     1208chicken-uninstall.c: $(SRCDIR)chicken-uninstall.scm
     1209        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -ignore-repository -output-file $@
     1210chicken-status.c: $(SRCDIR)chicken-status.scm
     1211        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -ignore-repository -output-file $@
    10471212csc.c: $(SRCDIR)csc.scm
    10481213        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
     
    10501215        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    10511216
     1217setup-api.c: $(SRCDIR)setup-api.scm
     1218        $(CHICKEN) $< $(CHICKEN_DYNAMIC_OPTIONS) -emit-import-library setup-api \
     1219          -ignore-repository -output-file $@
     1220setup-download.c: $(SRCDIR)setup-download.scm setup-api.import.scm
     1221        $(CHICKEN) $< $(CHICKEN_DYNAMIC_OPTIONS) -emit-import-library setup-download \
     1222          -ignore-repository -output-file $@
     1223
    10521224# distribution files
    10531225
    1054 .PHONY: distfiles
    1055 
    1056 distfiles: buildsvnrevision library.c eval.c data-structures.c ports.c files.c extras.c lolevel.c utils.c \
     1226.PHONY: distfiles dist
     1227
     1228distfiles: buildsvnrevision library.c eval.c expand.c chicken-syntax.c \
     1229        data-structures.c ports.c files.c extras.c lolevel.c utils.c \
    10571230        tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c \
    1058         posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c match.c \
     1231        posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c \
    10591232        ulibrary.c ueval.c udata-structures.c uports.c ufiles.c uextras.c ulolevel.c \
    10601233        uutils.c utcp.c usrfi-1.c usrfi-4.c usrfi-13.c usrfi-14.c \
    10611234        usrfi-18.c usrfi-69.c uposixunix.c uposixwin.c uregex.c \
    1062         chicken-profile.c chicken-setup.c csc.c csi.c \
    1063         chicken.c batch-driver.c compiler.c optimizer.c support.c \
    1064         c-platform.c c-backend.c chicken-bug.c
     1235        chicken-profile.c chicken-install.c chicken-uninstall.c chicken-status.c \
     1236        csc.c csi.c chicken.c batch-driver.c compiler.c optimizer.c support.c \
     1237        c-platform.c c-backend.c chicken-bug.c $(IMPORT_LIBRARIES:=.import.c)
     1238
     1239dist: distfiles
     1240        $(CSI) -s $(SRCDIR)scripts/makedist.scm
    10651241
    10661242# cleaning up
     
    10691245
    10701246ifeq ($(PLATFORM),mingw)
    1071 CLEAN_PCRE = $(PCRE_DIR)*$(O)
    10721247CLEAN_MINGW_LIBS = libchickengui.a libchickengui.dll libchickengui.dll.a
    10731248else
    1074 CLEAN_PCRE = $(PCRE_DIR)*$(O)
    10751249CLEAN_MINGW_LIBS =
    10761250endif
     
    10781252clean:
    10791253        -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) chicken$(EXE) csi$(EXE) csc$(EXE) \
    1080           chicken-setup$(EXE) chicken-profile$(EXE) csi-static$(EXE) \
     1254          chicken-profile$(EXE) csi-static$(EXE) \
     1255          chicken-install$(EXE) chicken-uninstall$(EXE) chicken-status$(EXE) \
    10811256          csc-static$(EXE) chicken-static$(EXE) chicken-bug$(EXE) chicken.info *$(O) \
    10821257          $(LIBCHICKEN_SO_FILE) $(LIBUCHICKEN_SO_FILE) $(LIBCHICKENGUI_SO_FILE) \
    1083           libchicken$(A) libuchicken$(A) libchickengui$(A) libchicken$(SO) libuchicken$(SO) \
    1084           $(PROGRAM_IMPORT_LIBRARIES) $(LIBCHICKEN_IMPORT_LIBRARY) $(LIBUCHICKEN_IMPORT_LIBRARY) \
    1085           $(LIBCHICKENGUI_IMPORT_LIBRARY)  $(MSVC_CHICKEN_EXPORT_FILES) \
    1086           chicken.info $(CLEAN_PCRE) $(CLEAN_MINGW_LIBS) $(CLEAN_MANIFESTS)
     1258          libchicken$(A) libuchicken$(A) libchickengui$(A) libchicken$(SO) $(PROGRAM_IMPORT_LIBRARIES) \
     1259          $(IMPORT_LIBRARIES:=.import.so) $(LIBCHICKEN_IMPORT_LIBRARY) $(LIBUCHICKEN_IMPORT_LIBRARY) $(LIBCHICKENGUI_IMPORT_LIBRARY)  \
     1260          $(MSVC_CHICKEN_EXPORT_FILES) chicken.info $(CLEAN_MINGW_LIBS) \
     1261          $(CLEAN_MANIFESTS)
     1262
    10871263confclean:
    10881264        -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) chicken-config.h chicken-defaults.h buildsvnrevision
    10891265
    10901266spotless: distclean
    1091         -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) library.c eval.c data-structures.c ports.c files.c \
    1092           extras.c lolevel.c utils.c tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c \
    1093           posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c match.c \
     1267        -$(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) library.c eval.c data-structures.c \
     1268          ports.c files.c extras.c lolevel.c utils.c chicken-syntax.c \
     1269          tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c expand.c \
     1270          posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c \
    10941271          ulibrary.c ueval.c udata-structures.c uports.c ufiles.c uextras.c ulolevel.c \
    10951272          uutils.c utcp.c usrfi-1.c usrfi-4.c usrfi-13.c usrfi-14.c \
    1096           usrfi-18.c usrfi-69.c uposixunix.c uposixwin.c uregex.c chicken-profile.c chicken-setup.c chicken-bug.c \
    1097           csc.c csi.c \
     1273          usrfi-18.c usrfi-69.c uposixunix.c uposixwin.c uregex.c chicken-profile.c chicken-bug.c \
     1274          csc.c csi.c chicken-install.c chicken-uninstall.c chicken-status.c \
    10981275          chicken.c batch-driver.c compiler.c optimizer.c support.c \
    1099           c-platform.c c-backend.c *.exports
     1276          c-platform.c c-backend.c \
     1277          $(IMPORT_LIBRARIES:=.import.c)
    11001278
    11011279distclean: clean confclean
     
    11051283.PHONY: check fullcheck compiler-check
    11061284
    1107 check: all
     1285check: $(CHICKEN_SHARED_EXECUTABLE) $(CSI_SHARED_EXECUTABLE) $(CSC_PROGRAM)
    11081286        cd tests; sh runtests.sh
    11091287
     
    11341312.PHONY: bootstrap bootstrap.tar.gz
    11351313
    1136 bootstrap: $(SRCDIR)bootstrap.tar.gz
     1314bootstrap:
    11371315        gzip -d -c $(SRCDIR)bootstrap.tar.gz | tar xvf -
    11381316        touch *.c
    1139         $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) STATICBUILD=1 chicken$(EXE)
    1140         cp chicken$(EXE) chicken-boot$(EXE)
     1317        $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) STATICBUILD=1 DEBUGBUILD=1 PLATFORM=$(PLATFORM) \
     1318          chicken$(EXE)
     1319        $(COPY_COMMAND) chicken$(EXE) chicken-boot$(EXE)
    11411320        touch *.scm
     1321        $(MAKE) -f $(SRCDIR)Makefile.$(PLATFORM) PLATFORM=$(PLATFORM) confclean
    11421322
    11431323$(SRCDIR)bootstrap.tar.gz: distfiles
    1144         tar cfz $(SRCDIR)bootstrap.tar.gz library.c eval.c data-structures.c ports.c files.c extras.c \
    1145         lolevel.c utils.c tcp.c srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c \
    1146         posixunix.c posixwin.c regex.c scheduler.c profiler.c stub.c match.c $(COMPILER_OBJECTS_1:=.c)
    1147 
     1324        tar cfz $@ library.c eval.c data-structures.c ports.c files.c extras.c lolevel.c utils.c tcp.c \
     1325          srfi-1.c srfi-4.c srfi-13.c srfi-14.c srfi-18.c srfi-69.c posixunix.c posixwin.c regex.c \
     1326          scheduler.c profiler.c stub.c expand.c chicken-syntax.c \
     1327          $(COMPILER_OBJECTS_1:=.c)
     1328
     1329
     1330# benchmarking
     1331
     1332.PHONY: bench
     1333
     1334bench:
     1335        here=`pwd`; \
     1336        cd $(SRCDIR)benchmarks; \
     1337        LD_LIBRARY_PATH=$$here DYLD_LIBRARY_PATH=$$here PATH=$$here:$$PATH \
     1338        csi -s cscbench.scm $(BENCHMARK_OPTIONS)
Note: See TracChangeset for help on using the changeset viewer.