Changeset 7276 in project for chicken/branches/release/rules.make


Ignore:
Timestamp:
01/05/08 20:17:50 (13 years ago)
Author:
felix winkelmann
Message:

merged trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/release/rules.make

    r6577 r7276  
    3636# object files
    3737
    38 LIBCHICKEN_SHARED_OBJECTS = library$(O) eval$(O) extras$(O) lolevel$(O) utils$(O) \
    39         tcp$(O) srfi-1$(O) srfi-4$(O) srfi-13$(O) srfi-14$(O) srfi-18$(O) \
    40         $(POSIXFILE)$(O) regex$(O) regex-extras$(O) scheduler$(O) profiler$(O) stub$(O) match$(O) \
    41          scheduler$(O) profiler$(O) stub$(O) match$(O) runtime$(O)
    42 LIBUCHICKEN_SHARED_OBJECTS = ulibrary$(O) ueval$(O) uextras$(O) ulolevel$(O) \
    43         uutils$(O) utcp$(O) usrfi-1$(O) usrfi-4$(O) usrfi-13$(O) usrfi-14$(O) \
    44         usrfi-18$(O) u$(POSIXFILE)$(O) uregex$(O) scheduler$(O) profiler$(O) \
    45         stub$(O) match$(O) uruntime$(O)
    46 LIBCHICKENGUI_SHARED_OBJECTS = library$(O) eval$(O) extras$(O) lolevel$(O) utils$(O) \
    47         tcp$(O) srfi-1$(O) srfi-4$(O) srfi-13$(O) srfi-14$(O) srfi-18$(O) \
    48         $(POSIXFILE)$(O) regex$(O) regex-extras$(O) scheduler$(O) profiler$(O) stub$(O) match$(O) \
    49          scheduler$(O) profiler$(O) stub$(O) match$(O) gui-runtime$(O)
    50 LIBCHICKEN_STATIC_OBJECTS = library-static$(O) eval-static$(O) extras-static$(O) \
    51         lolevel-static$(O) utils-static$(O) tcp-static$(O) srfi-1-static$(O) \
    52         srfi-4-static$(O) srfi-13-static$(O) srfi-14-static$(O) srfi-18-static$(O) \
    53         $(POSIXFILE)-static$(O) regex-static$(O) regex-extras-static$(O) scheduler-static$(O) \
    54         profiler-static$(O) stub-static$(O) match-static$(O) runtime-static$(O)
    55 LIBUCHICKEN_STATIC_OBJECTS = ulibrary-static$(O) ueval-static$(O) uextras-static$(O) \
    56         ulolevel-static$(O) uutils-static$(O) utcp-static$(O) usrfi-1-static$(O) \
    57         usrfi-4-static$(O) usrfi-13-static$(O) usrfi-14-static$(O) usrfi-18-static$(O) \
    58         u$(POSIXFILE)-static$(O) uregex-static$(O) scheduler-static$(O) \
    59         profiler-static$(O) stub-static$(O) match-static$(O) uruntime-static$(O)
    60 LIBCHICKENGUI_STATIC_OBJECTS = library-static$(O) eval-static$(O) extras-static$(O) \
    61         lolevel-static$(O) utils-static$(O) tcp-static$(O) srfi-1-static$(O) \
    62         srfi-4-static$(O) srfi-13-static$(O) srfi-14-static$(O) srfi-18-static$(O) \
    63         $(POSIXFILE)-static$(O) regex-static$(O) regex-extras-static$(O) scheduler-static$(O) \
    64         profiler-static$(O) stub-static$(O) match-static$(O) gui-runtime-static$(O)
    65 
    66 PCRE_SHARED_OBJECTS = \
    67   pcre/pcre_compile$(O) \
    68   pcre/pcre_config$(O) \
    69   pcre/pcre_dfa_exec$(O) \
    70   pcre/pcre_exec$(O) \
    71   pcre/pcre_fullinfo$(O) \
    72   pcre/pcre_get$(O) \
    73   pcre/pcre_globals$(O) \
    74   pcre/pcre_info$(O) \
    75   pcre/pcre_maketables$(O) \
    76   pcre/pcre_newline$(O) \
    77   pcre/pcre_ord2utf8$(O) \
    78   pcre/pcre_refcount$(O) \
    79   pcre/pcre_study$(O) \
    80   pcre/pcre_tables$(O) \
    81   pcre/pcre_try_flipped$(O) \
    82   pcre/pcre_ucp_searchfuncs$(O) \
    83   pcre/pcre_valid_utf8$(O) \
    84   pcre/pcre_version$(O) \
    85   pcre/pcre_xclass$(O) \
    86   pcre/pcre_chartables$(O)
    87 PCRE_STATIC_OBJECTS = \
    88   pcre/pcre_compile-static$(O) \
    89   pcre/pcre_config-static$(O) \
    90   pcre/pcre_dfa_exec-static$(O) \
    91   pcre/pcre_exec-static$(O) \
    92   pcre/pcre_fullinfo-static$(O) \
    93   pcre/pcre_get-static$(O) \
    94   pcre/pcre_globals-static$(O) \
    95   pcre/pcre_info-static$(O) \
    96   pcre/pcre_maketables-static$(O) \
    97   pcre/pcre_newline-static$(O) \
    98   pcre/pcre_ord2utf8-static$(O) \
    99   pcre/pcre_refcount-static$(O) \
    100   pcre/pcre_study-static$(O) \
    101   pcre/pcre_tables-static$(O) \
    102   pcre/pcre_try_flipped-static$(O) \
    103   pcre/pcre_ucp_searchfuncs-static$(O) \
    104   pcre/pcre_valid_utf8-static$(O) \
    105   pcre/pcre_version-static$(O) \
    106   pcre/pcre_xclass-static$(O) \
    107   pcre/pcre_chartables-static$(O)
    108 
    109 COMPILER_OBJECTS = chicken$(O) batch-driver$(O) compiler$(O) optimizer$(O) support$(O) \
    110         c-platform$(O) c-backend$(O)
    111 COMPILER_STATIC_OBJECTS = chicken-static$(O) batch-driver-static$(O) \
    112         compiler-static$(O) optimizer-static$(O) support-static$(O) \
    113         c-platform-static$(O) c-backend-static$(O)
     38LIBCHICKEN_OBJECTS_1 = \
     39       library eval extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
     40       srfi-14 srfi-18 $(POSIXFILE) regex regex-extras scheduler \
     41       profiler stub match runtime
     42LIBCHICKEN_SHARED_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=$(O))
     43LIBCHICKEN_STATIC_OBJECTS = $(LIBCHICKEN_OBJECTS_1:=-static$(O))
     44
     45LIBUCHICKEN_OBJECTS_1 = \
     46       ulibrary ueval uextras ulolevel uutils utcp usrfi-1 usrfi-4 \
     47       usrfi-13 usrfi-14 usrfi-18 u$(POSIXFILE) uregex scheduler \
     48       profiler stub match uruntime
     49LIBUCHICKEN_SHARED_OBJECTS = $(LIBUCHICKEN_OBJECTS_1:=$(O))
     50LIBUCHICKEN_STATIC_OBJECTS = $(LIBUCHICKEN_OBJECTS_1:=-static$(O))
     51
     52LIBCHICKENGUI_OBJECTS_1 = \
     53       library eval extras lolevel utils tcp srfi-1 srfi-4 srfi-13 \
     54       srfi-14 srfi-18 $(POSIXFILE) regex regex-extras scheduler \
     55       profiler stub match gui-runtime
     56LIBCHICKENGUI_SHARED_OBJECTS = $(LIBCHICKENGUI_OBJECTS_1:=$(O))
     57LIBCHICKENGUI_STATIC_OBJECTS = $(LIBCHICKENGUI_OBJECTS_1:=-static$(O))
     58
     59PCRE_OBJECTS_1 = \
     60       pcre/pcre_compile \
     61       pcre/pcre_config \
     62       pcre/pcre_dfa_exec \
     63       pcre/pcre_exec \
     64       pcre/pcre_fullinfo \
     65       pcre/pcre_get \
     66       pcre/pcre_globals \
     67       pcre/pcre_info \
     68       pcre/pcre_maketables \
     69       pcre/pcre_newline \
     70       pcre/pcre_ord2utf8 \
     71       pcre/pcre_refcount \
     72       pcre/pcre_study \
     73       pcre/pcre_tables \
     74       pcre/pcre_try_flipped \
     75       pcre/pcre_ucp_searchfuncs \
     76       pcre/pcre_valid_utf8 \
     77       pcre/pcre_version \
     78       pcre/pcre_xclass \
     79       pcre/pcre_chartables
     80PCRE_SHARED_OBJECTS = $(PCRE_OBJECTS_1:=$(O))
     81PCRE_STATIC_OBJECTS = $(PCRE_OBJECTS_1:=-static$(O))
     82
     83COMPILER_OBJECTS_1 = \
     84       chicken batch-driver compiler optimizer support \
     85       c-platform c-backend
     86COMPILER_OBJECTS        = $(COMPILER_OBJECTS_1:=$(O))
     87COMPILER_STATIC_OBJECTS = $(COMPILER_OBJECTS_1:=-static$(O))
    11488
    11589# library objects
     
    639613# program objects
    640614
    641 chicken-profile$(O): chicken-profile.c chicken.h $(CHICKEN_CONFIG_H) libchicken$(SO)
     615chicken-profile$(O): chicken-profile.c chicken.h $(CHICKEN_CONFIG_H)
    642616        $(C_COMPILER) $(C_COMPILER_OPTIONS) $(C_COMPILER_PTABLES_OPTIONS) $(INCLUDES) \
    643617          $(C_COMPILER_COMPILE_OPTION) $(C_COMPILER_OPTIMIZATION_OPTIONS) $< $(C_COMPILER_OUTPUT_OPTION) $@
     
    663637# libchicken
    664638
     639.PHONY: libs
     640
     641libs: $(TARGETLIBS)
     642
    665643libchicken$(SO): $(LIBCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
    666         $(LINKER) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_LINKER_OPTIONS) \
     644        $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_LINKER_OPTIONS) \
    667645          $(LINKER_OUTPUT_OPTION) $@ $^ $(LIBCHICKEN_SO_LIBRARIES)
    668646
    669647libuchicken$(SO): $(LIBUCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
    670         $(LINKER) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBUCHICKEN_SO_LINKER_OPTIONS) \
     648        $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBUCHICKEN_SO_LINKER_OPTIONS) \
    671649          $(LINKER_OUTPUT_OPTION) $@ $^ $(LIBUCHICKEN_SO_LIBRARIES)
    672650
     651cygchicken-0.dll: $(LIBCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
     652        gcc -shared -o $(LIBCHICKEN_SO_FILE) -Wl,--dll -Wl,--add-stdcall-alias \
     653            -Wl,--enable-stdcall-fixup -Wl,--warn-unresolved-symbols \
     654            -Wl,--dll-search-prefix=cyg -Wl,--allow-multiple-definition \
     655            -Wl,--allow-shlib-undefined -Wl,--export-dynamic \
     656            -Wl,--out-implib=libchicken.dll.a -Wl,--export-all-symbols \
     657            -Wl,--enable-auto-import \
     658            -Wl,--whole-archive $(LIBCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT) \
     659            -Wl,--no-whole-archive $(LIBCHICKEN_SO_LIBRARIES)
     660
     661cyguchicken-0.dll: $(LIBUCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
     662        gcc -shared -o $(LIBUCHICKEN_SO_FILE) -Wl,--dll -Wl,--add-stdcall-alias \
     663            -Wl,--enable-stdcall-fixup -Wl,--warn-unresolved-symbols \
     664            -Wl,--dll-search-prefix=cyg -Wl,--allow-multiple-definition \
     665            -Wl,--allow-shlib-undefined -Wl,--export-dynamic \
     666            -Wl,--out-implib=libuchicken.dll.a -Wl,--export-all-symbols \
     667            -Wl,--enable-auto-import \
     668            -Wl,--whole-archive $(LIBUCHICKEN_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT) \
     669            -Wl,--no-whole-archive $(LIBUCHICKEN_SO_LIBRARIES)
     670
     671
    673672libchickengui$(SO): $(LIBCHICKENGUI_SHARED_OBJECTS) $(PCRE_SHARED_OBJECTS) $(APPLY_HACK_OBJECT)
    674         $(LINKER) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBCHICKENGUI_SO_LINKER_OPTIONS) \
     673        $(LINKER) $(LINKER_OPTIONS) $(LINKER_LINK_SHARED_LIBRARY_OPTIONS) $(LIBCHICKENGUI_SO_LINKER_OPTIONS) \
    675674          $(LINKER_OUTPUT_OPTION) $@ $^ $(LIBCHICKENGUI_SO_LIBRARIES)
    676675
     
    687686
    688687$(CHICKEN_SHARED_EXECUTABLE): $(COMPILER_OBJECTS) $(PRIMARY_LIBCHICKEN)
    689         $(LINKER) $(LINKER_OPTIONS) $(COMPILER_OBJECTS) $(LINKER_OUTPUT_OPTION) $@ \
    690           $(LINKER_LIBRARY_OPTION)chicken $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     688        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $(COMPILER_OBJECTS) $(LINKER_OUTPUT_OPTION) $@ \
     689          $(LINKER_LIBRARY_OPTION)chicken $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
    691690
    692691$(CSI_SHARED_EXECUTABLE): csi$(O) $(PRIMARY_LIBCHICKEN)
    693         $(LINKER) $(LINKER_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ $(LINKER_LIBRARY_OPTION)chicken \
    694           $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     692        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ \
     693          $(LINKER_LIBRARY_OPTION)chicken $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
    695694
    696695$(CHICKEN_SETUP_PROGRAM)$(EXE): chicken-setup$(O) $(PRIMARY_LIBCHICKEN)
    697         $(LINKER) $(LINKER_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ $(LINKER_LIBRARY_OPTION)chicken \
    698           $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     696        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ \
     697          $(LINKER_LIBRARY_OPTION)chicken $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
    699698
    700699$(CHICKEN_PROFILE_PROGRAM)$(EXE): chicken-profile$(O) $(PRIMARY_LIBCHICKEN)
    701         $(LINKER) $(LINKER_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ $(LINKER_LIBRARY_OPTION)chicken \
    702           $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     700        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ \
     701          $(LINKER_LIBRARY_OPTION)chicken $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
    703702
    704703$(CSC_PROGRAM)$(EXE): csc$(O) $(PRIMARY_LIBCHICKEN)
    705         $(LINKER) $(LINKER_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ $(LINKER_LIBRARY_OPTION)chicken \
    706           $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
     704        $(LINKER) $(LINKER_OPTIONS) $(LINKER_EXECUTABLE_OPTIONS) $< $(LINKER_OUTPUT_OPTION) $@ \
     705          $(LINKER_LIBRARY_OPTION)chicken $(LINKER_LINK_SHARED_PROGRAM_OPTIONS) $(LIBRARIES)
    707706
    708707# static executables
    709708
    710709$(CHICKEN_STATIC_EXECUTABLE): $(COMPILER_STATIC_OBJECTS) libchicken$(A)
    711         $(LINKER) $(LINKER_LINK_STATIC_OPTION) $(COMPILER_STATIC_OBJECTS) $(LINKER_OUTPUT_OPTION) $@ \
    712           libchicken$(A) $(LIBRARIES)
    713 $(CSI_STATIC_EXECUTABLE): csi$(O)
    714         $(LINKER) $(LINKER_LINK_STATIC_OPTION) $< $(LINKER_OUTPUT_OPTION) $@ libchicken$(A) $(LIBRARIES)
    715 $(CHICKEN_BUG_PROGRAM)$(EXE): chicken-bug$(O) $(PRIMARY_LIBCHICKEN)
    716         $(LINKER) $(LINKER_LINK_STATIC_OPTION) $< $(LINKER_OUTPUT_OPTION) $@ libchicken$(A) $(LIBRARIES)
     710        $(LINKER) $(LINKER_OPTIONS) $(LINKER_STATIC_OPTIONS) $(COMPILER_STATIC_OBJECTS) \
     711          $(LINKER_OUTPUT_OPTION) $@ libchicken$(A) $(LIBRARIES)
     712$(CSI_STATIC_EXECUTABLE): csi$(O) libchicken$(A)
     713        $(LINKER) $(LINKER_OPTIONS) $(LINKER_STATIC_OPTIONS) $< $(LINKER_OUTPUT_OPTION) \
     714          $@ libchicken$(A) $(LIBRARIES)
     715$(CHICKEN_BUG_PROGRAM)$(EXE): chicken-bug$(O) libchicken$(A)
     716        $(LINKER) $(LINKER_OPTIONS) $(LINKER_STATIC_OPTIONS) $< $(LINKER_OUTPUT_OPTION) \
     717          $@ libchicken$(A) $(LIBRARIES)
    717718
    718719# info documentation
     
    726727
    727728install-libs:
    728         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(LIBDIR)
    729         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(EGGDIR)
    730         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(INCDIR)
    731         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) libchicken$(A) \
    732           libuchicken$(A) $(LIBCHICKEN_IMPORT_LIBRARY) $(LIBUCHICKEN_IMPORT_LIBRARY) \
    733           $(LIBDIR)
     729ifneq ($(DESTDIR),)
     730        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)
     731endif
     732        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(ILIBDIR)
     733        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(ICHICKENLIBDIR)
     734        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IEGGDIR)
     735        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IINCDIR)
     736        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)
     737        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) libchicken$(A) $(DESTDIR)$(ILIBDIR)
     738        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) libuchicken$(A) $(DESTDIR)$(ILIBDIR)
     739ifneq ($(LIBCHICKEN_IMPORT_LIBRARY),)
     740        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) $(LIBCHICKEN_IMPORT_LIBRARY) $(DESTDIR)$(ILIBDIR)
     741        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) $(LIBUCHICKEN_IMPORT_LIBRARY) $(DESTDIR)$(ILIBDIR)
     742ifdef WINDOWS
     743        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS) $(LIBCHICKENGUI_IMPORT_LIBRARY) $(DESTDIR)$(ILIBDIR)
     744endif
     745endif
     746ifneq ($(POSTINSTALL_STATIC_LIBRARY),true)
    734747        $(POSTINSTALL_STATIC_LIBRARY) $(POSTINSTALL_STATIC_LIBRARY_FLAGS) \
    735           $(LIBDIR)/libchicken$(A)
     748          $(ILIBDIR)/libchicken$(A)
    736749        $(POSTINSTALL_STATIC_LIBRARY) $(POSTINSTALL_STATIC_LIBRARY_FLAGS) \
    737           $(LIBDIR)/libuchicken$(A)
    738         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.h $(CHICKEN_CONFIG_H) $(INCDIR)
     750          $(ILIBDIR)/libuchicken$(A)
     751endif
     752        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.h $(DESTDIR)$(IINCDIR)
     753        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(CHICKEN_CONFIG_H) $(DESTDIR)$(IINCDIR)
    739754ifndef STATICBUILD
    740         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) libchicken$(SO) \
    741           libuchicken$(SO) $(LIBDIR)
     755ifdef DLLSINPATH
     756        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) $(DESTDIR)$(IBINDIR)
     757        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBUCHICKEN_SO_FILE) $(DESTDIR)$(IBINDIR)
     758else
     759        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBCHICKEN_SO_FILE) $(DESTDIR)$(ILIBDIR)
     760        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) $(LIBUCHICKEN_SO_FILE) $(DESTDIR)$(ILIBDIR)
     761endif
    742762ifdef WINDOWS
    743763        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS) libchickengui$(SO) \
    744           $(LIBDIR)
    745 endif
    746 endif
    747 
     764          $(DESTDIR)$(ILIBDIR)
     765endif
     766endif
     767
     768ifeq ($(NEEDS_RELINKING),yes)
     769install:
     770        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(CHICKEN_PROGRAM)$(EXE) \
     771          $(CSI_PROGRAM)$(EXE) $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) \
     772          $(CHICKEN_SETUP_PROGRAM)$(EXE)
     773        $(MAKE) NEEDS_RELINKING=no RUNTIME_LINKER_PATH=$(LIBDIR) install
     774        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_PROGRAM)$(EXE) $(CSI_PROGRAM)$(EXE) \
     775          $(CSC_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE)
     776ifndef STATICBUILD
     777        $(MAKE_WRITABLE_COMMAND) $(CHICKEN_SETUP_PROGRAM)$(EXE)
     778endif
     779else
    748780install: $(TARGETS) install-libs
    749         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(BINDIR)
    750         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(MANDIR)
    751         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(INFODIR)
    752         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DOCDIR)
    753         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_PROGRAM)$(EXE) \
    754           $(CSI_PROGRAM)$(EXE) $(CHICKEN_PROFILE_PROGRAM)$(EXE) $(CSC_PROGRAM)$(EXE) \
    755           $(CHICKEN_BUG_PROGRAM)$(EXE) $(BINDIR)
    756         $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(BINDIR)/$(CHICKEN_PROGRAM)
    757         $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(BINDIR)/$(CSI_PROGRAM)
    758         $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(BINDIR)/$(CHICKEN_PROFILE_PROGRAM)
    759         $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(BINDIR)/$(CSC_PROGRAM)
    760         $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(BINDIR)/$(CHICKEN_BUG_PROGRAM)
     781ifneq ($(DESTDIR),)
     782        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)
     783endif
     784        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)
     785        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(ITOPMANDIR)
     786        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IMANDIR)
     787        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IINFODIR)
     788        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IDOCDIR)
     789        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     790        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CSI_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     791        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_PROFILE_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     792        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CSC_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     793        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_BUG_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)
     794ifneq ($(POSTINSTALL_PROGRAM),true)
     795        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(IBINDIR)/$(CHICKEN_PROGRAM)
     796        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(IBINDIR)/$(CSI_PROGRAM)
     797        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(IBINDIR)/$(CHICKEN_PROFILE_PROGRAM)
     798        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(IBINDIR)/$(CSC_PROGRAM)
     799        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(IBINDIR)/$(CHICKEN_BUG_PROGRAM)
     800endif
    761801ifndef STATICBUILD
    762802        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(CHICKEN_SETUP_PROGRAM)$(EXE) \
    763           $(BINDIR)
    764         $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(BINDIR)/$(CHICKEN_SETUP_PROGRAM)
    765 endif
    766         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.1 csi.1 csc.1 chicken-setup.1 \
    767           chicken-profile.1 chicken-bug.1 $(MANDIR)
    768         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DOCDIR)/html
    769         -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) html/* $(DOCDIR)/html
    770         -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.pdf $(DOCDIR)
    771         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) README LICENSE $(DOCDIR)
    772         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-more-macros.scm \
    773           chicken-ffi-macros.scm chicken-sys-macros.scm $(DATADIR)
    774         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) *.exports $(DATADIR)
    775         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.info $(INFODIR)
    776         $(INSTALLINFO_PROGRAM) $(INSTALLINFO_PROGRAM_OPTIONS) --infodir=$(INFODIR) chicken.info
     803          $(DESTDIR)$(IBINDIR)
     804ifneq ($(POSTINSTALL_PROGRAM),true)
     805        $(POSTINSTALL_PROGRAM) $(POSTINSTALL_PROGRAM_FLAGS) $(IBINDIR)/$(CHICKEN_SETUP_PROGRAM)
     806endif
     807endif
     808        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.1 $(DESTDIR)$(IMANDIR)
     809        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) csi.1 $(DESTDIR)$(IMANDIR)
     810        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) csc.1 $(DESTDIR)$(IMANDIR)
     811        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-setup.1 $(DESTDIR)$(IMANDIR)
     812        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-profile.1 $(DESTDIR)$(IMANDIR)
     813        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-bug.1 $(DESTDIR)$(IMANDIR)
     814        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IDOCDIR)/html
     815        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) html/* $(DESTDIR)$(IDOCDIR)/html
     816        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.pdf $(DESTDIR)$(IDOCDIR)
     817        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) README $(DESTDIR)$(IDOCDIR)
     818        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) LICENSE $(DESTDIR)$(IDOCDIR)
     819        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-more-macros.scm $(DESTDIR)$(IDATADIR)
     820        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-ffi-macros.scm $(DESTDIR)$(IDATADIR)
     821        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken-sys-macros.scm $(DESTDIR)$(IDATADIR)
     822        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) *.exports $(DESTDIR)$(IDATADIR)
     823        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.info $(DESTDIR)$(IINFODIR)
     824        $(INSTALLINFO_PROGRAM) $(INSTALLINFO_PROGRAM_OPTIONS) --infodir=$(DESTDIR)$(IINFODIR) chicken.info
    777825ifdef WINDOWS
    778         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) csibatch.bat $(BINDIR)
     826        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) csibatch.bat $(DESTDIR)$(IBINDIR)
     827endif
    779828endif
    780829
    781830uninstall:
    782         $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(BINDIR)/$(CHICKEN_PROGRAM)$(EXE) \
    783           $(BINDIR)/$(CSI_PROGRAM)$(EXE) $(BINDIR)/$(CHICKEN_PROFILE_PROGRAM)$(EXE) \
    784           $(BINDIR)/$(CHICKEN_SETUP_PROGRAM)$(EXE) $(BINDIR)/$(CSC_PROGRAM)$(EXE) \
    785           $(BINDIR)/$(CHICKEN_BUG)$(EXE)
    786         $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(LIBDIR)/libchicken.* $(LIBDIR)/libuchicken.*
    787         $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(MANDIR)/chicken.1 $(MANDIR)/csi.1 $(MANDIR)/csc.1 \
    788           $(MANDIR)/chicken-profile.1 $(MANDIR)/chicken-setup.1 $(MANDIR)/chicken-bug.1
    789         $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(INCDIR)/chicken.h $(INCDIR)/chicken-config.h
    790         $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) $(DATADIR)
    791         $(UNINSTALLINFO_PROGRAM) $(UNINSTALLINFO_PROGRAM_OPTIONS) chicken.info
     831        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROGRAM)$(EXE) \
     832          $(DESTDIR)$(IBINDIR)/$(CSI_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)/$(CHICKEN_PROFILE_PROGRAM)$(EXE) \
     833          $(DESTDIR)$(IBINDIR)/$(CHICKEN_SETUP_PROGRAM)$(EXE) $(DESTDIR)$(IBINDIR)/$(CSC_PROGRAM)$(EXE) \
     834          $(DESTDIR)$(IBINDIR)/$(CHICKEN_BUG_PROGRAM)$(EXE)
     835        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(ILIBDIR)/libchicken.* $(DESTDIR)$(ILIBDIR)/libuchicken.*
     836ifdef ($(PLATFORM),cygwin)
     837        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)/cygchicken* $(DESTDIR)$(IBINDIR)/cyguchicken*
     838endif
     839        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IMANDIR)/chicken.1 $(DESTDIR)$(IMANDIR)/csi.1 \
     840          $(DESTDIR)$(IMANDIR)/csc.1 $(DESTDIR)$(IMANDIR)/chicken-profile.1 $(DESTDIR)$(IMANDIR)/chicken-setup.1 \
     841          $(DESTDIR)$(IMANDIR)/chicken-bug.1
     842        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IINCDIR)/chicken.h $(DESTDIR)$(IINCDIR)/chicken-config.h
     843        $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) $(DESTDIR)$(IDATADIR)
     844        $(UNINSTALLINFO_PROGRAM) $(UNINSTALLINFO_PROGRAM_OPTIONS) --infodir=$(DESTDIR)$(IINFODIR) chicken.info
     845ifdef WINDOWS
     846        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)/csibatch.bat
     847endif
    792848
    793849# bootstrapping c sources
     
    799855eval.c: eval.scm
    800856        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
    801 extras.c: extras.scm
    802         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
     857extras.c: extras.scm private-namespace.scm
     858        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@ -extend private-namespace.scm
    803859lolevel.c: lolevel.scm
    804860        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) -output-file $@
     
    838894ueval.c: eval.scm
    839895        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    840 uextras.c: extras.scm
    841         $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
     896uextras.c: extras.scm private-namespace.scm
     897        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@ -extend private-namespace.scm
    842898ulolevel.c: lolevel.scm
    843899        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
     
    865921        $(CHICKEN) $< $(CHICKEN_LIBRARY_OPTIONS) $(CHICKEN_UNSAFE_OPTIONS) -output-file $@
    866922
    867 chicken.c: chicken.scm chicken-more-macros.scm chicken-ffi-macros.scm
    868         $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    869 support.c: support.scm banner.scm
    870         $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    871 compiler.c: compiler.scm
    872         $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    873 optimizer.c: optimizer.scm
    874         $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    875 batch-driver.c: batch-driver.scm
    876         $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    877 c-platform.c: c-platform.scm
    878         $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    879 c-backend.c: c-backend.scm
    880         $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
    881 
    882 csi.c: csi.scm banner.scm chicken-more-macros.scm
    883         $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
     923chicken.c: chicken.scm chicken-more-macros.scm chicken-ffi-macros.scm private-namespace.scm
     924        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
     925support.c: support.scm banner.scm private-namespace.scm
     926        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
     927compiler.c: compiler.scm private-namespace.scm
     928        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
     929optimizer.c: optimizer.scm private-namespace.scm
     930        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
     931batch-driver.c: batch-driver.scm private-namespace.scm
     932        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
     933c-platform.c: c-platform.scm private-namespace.scm
     934        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
     935c-backend.c: c-backend.scm private-namespace.scm
     936        $(CHICKEN) $< $(CHICKEN_COMPILER_OPTIONS) -output-file $@
     937
     938csi.c: csi.scm banner.scm chicken-more-macros.scm private-namespace.scm
     939        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@ -extend private-namespace.scm
    884940chicken-profile.c: chicken-profile.scm
    885941        $(CHICKEN) $< $(CHICKEN_PROGRAM_OPTIONS) -output-file $@
     
    911967ifeq ($(PLATFORM),mingw)
    912968CLEAN_PCRE = pcre\*$(O)
    913 CLEAN_MINGW_LIBS = libchicken.dll.a libchickengui.a libchickengui.dll libchickengui.dll.a libuchicken.dll.a
     969CLEAN_MINGW_LIBS = libchickengui.a libchickengui.dll libchickengui.dll.a
    914970else
    915971CLEAN_PCRE = pcre/*$(O)
     
    921977          chicken-setup$(EXE) chicken-profile$(EXE) csi-static$(EXE) \
    922978          csc-static$(EXE) chicken-static$(EXE) chicken-bug$(EXE) chicken.info *$(O) \
    923           libchicken$(SO) libuchicken$(SO) libchicken$(A) libuchicken$(A) \
     979          $(LIBCHICKEN_SO_FILE) $(LIBUCHICKEN_SO_FILE) \
     980          libchicken$(A) libuchicken$(A) \
     981          $(LIBCHICKEN_IMPORT_LIBRARY) $(LIBUCHICKEN_IMPORT_LIBRARY) \
    924982          chicken.info $(CLEAN_PCRE) $(CLEAN_MINGW_LIBS)
    925983
     
    9421000# run tests
    9431001
    944 .PHONY: check
     1002.PHONY: check fullcheck compiler-check
    9451003
    9461004check: all
    9471005        cd tests; sh runtests.sh
     1006
     1007# Only for UNIX, yet:
     1008
     1009fullcheck: check compiler-check
     1010
     1011compiler-check:
     1012        @echo "======================================== packing ..."
     1013        $(MAKE) dist
     1014        $(REMOVE_COMMAND $(REMOVE_COMMAND_RECURSIVE_OPTIONS) tests/chicken-*
     1015        tar -C tests -xzf `ls -t chicken-*.tar.gz | head -1`
     1016        @echo "======================================== building stage 1 ..."
     1017        $(MAKE) STATICBUILD=1 -C tests/chicken-* confclean all
     1018        touch tests/chicken-*/*.scm
     1019        @echo "======================================== building stage 2 ..."
     1020        $(MAKE) STATICBUILD=1 -C tests/chicken-* confclean all
     1021        cat tests/chicken-*/*.c >tests/stage2.out
     1022        @echo "======================================== building stage 3 ..."
     1023        $(MAKE) STATICBUILD=1 -C tests/chicken-* confclean all
     1024        cat tests/chicken-*/*.c >tests/stage3.out
     1025        diff tests/stage2.out tests/stage3.out >tests/stages.diff
     1026        $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) tests/chicken-*
     1027
     1028
     1029# bootstrap from C source tarball
     1030
     1031.PHONY: bootstrap bootstrap.tar.gz
     1032
     1033bootstrap:
     1034        gzip -d -c bootstrap.tar.gz | tar xvf -
     1035        touch *.c
     1036        $(MAKE) -f Makefile.$(PLATFORM) STATICBUILD=1 chicken
     1037        touch *.scm
     1038        $(MAKE) CHICKEN=./chicken all
     1039
     1040bootstrap.tar.gz:
     1041        tar cfz bootstrap.tar.gz $(LIBCHICKEN_OBJECTS_1:=.c) $(COMPILER_OBJECTS_1:=.c)
Note: See TracChangeset for help on using the changeset viewer.