Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
306 lines (285 sloc) 11.2 KB
# Makefile.mingw - configuration for MinGW (no MSYS) -*- Makefile -*-
#
# Copyright (c) 2008-2011, The Chicken Team
# Copyright (c) 2007, Felix L. Winkelmann
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this list of conditions and the following
# disclaimer.
# Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided with the distribution.
# Neither the name of the author nor the names of its contributors may be used to endorse or promote
# products derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
ifneq ($(CONFIG),)
include $(CONFIG)
endif
SEP = $(strip \)
SRCDIR =.$(SEP)
BRANCHNAME =
# platform configuration
DLLSINPATH = 1
ARCH ?= x86
WINDOWS = 1
WINDOWS_SHELL = 1
UNAME_SYS = MinGW
ifeq ($(ARCH),x86)
HACKED_APPLY ?= 1
else
HACKED_APPLY =
endif
# file extensions
SO = .dll
EXE = .exe
# options
C_COMPILER ?= gcc
C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H
ifdef DEBUGBUILD
C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
else
ifdef OPTIMIZE_FOR_SPEED
C_COMPILER_OPTIMIZATION_OPTIONS ?= -O3
else
C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os
endif
endif
C_COMPILER_SHARED_OPTIONS = -DPIC
RC_COMPILER ?= windres
LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared
LIBRARIES = -lm -lws2_32
LINKER_OPTIONS += -Wl,--enable-auto-import
LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX).dll.a
LIBCHICKEN_SO_LIBRARIES = -lm -lws2_32
LIBCHICKEN_IMPORT_LIBRARY = lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX).dll.a
MAKEDIR_COMMAND_OPTIONS =
CUSTOM_RC_FILE = 1
# special files
CHICKEN_CONFIG_H = chicken-config.h
APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O)
POSIXFILE = posixwin
# select default and internal settings
CUSTOM_CHICKEN_DEFAULTS=1
include $(SRCDIR)defaults.make
chicken-config.h: chicken-defaults.h
echo /* GENERATED */ >$@
echo #define HAVE_DIRENT_H 1 >>$@
echo #define HAVE_INTTYPES_H 1 >>$@
echo #define HAVE_LIMITS_H 1 >>$@
echo #define HAVE_LONG_LONG 1 >>$@
echo #define HAVE_MEMMOVE 1 >>$@
echo #define HAVE_MEMORY_H 1 >>$@
echo #define HAVE_STDINT_H 1 >>$@
echo #define HAVE_STDLIB_H 1 >>$@
echo #define HAVE_STRERROR 1 >>$@
echo #define HAVE_STRINGS_H 1 >>$@
echo #define HAVE_STRING_H 1 >>$@
echo #define HAVE_STRTOLL 1 >>$@
echo #define HAVE_SYS_STAT_H 1 >>$@
echo #define HAVE_SYS_TYPES_H 1 >>$@
echo #define HAVE_UNISTD_H 1 >>$@
echo #define HAVE_UNSIGNED_LONG_LONG 1 >>$@
echo #define HAVE_WINDOWS_H 1 >>$@
echo #define HAVE__STRTOI64 1 >>$@
echo #define STDC_HEADERS 1 >>$@
echo #define HAVE_DIRECT_H 1 >>$@
echo #define HAVE_ERRNO_H 1 >>$@
echo #define HAVE_GCVT 1 >>$@
echo #define HAVE_LOADLIBRARY 1 >>$@
echo #define HAVE_GETPROCADDRESS 1 >>$@
echo #define HAVE_WINSOCK2_H 1 >>$@
echo #define HAVE_WS2TCPIP_H 1 >>$@
echo #define C_STACK_GROWS_DOWNWARD 1 >>$@
ifdef GCHOOKS
echo #define C_GC_HOOKS >>$@
endif
ifdef SYMBOLGC
echo #define C_COLLECT_ALL_SYMBOLS >>$@
endif
ifneq ($(HACKED_APPLY),)
echo #define C_HACKED_APPLY >>$@
endif
type chicken-defaults.h >>$@
chicken-defaults.h:
ifdef OPTIMIZE_FOR_SPEED
echo /* (this build was optimized for speed) */ >>$@
endif
echo #define C_BUILD_TAG "$(BUILD_TAG)" >>$@
echo #define C_CHICKEN_PROGRAM "$(CHICKEN_PROGRAM)$(EXE)" >>$@
echo #define C_WINDOWS_SHELL 1 >>$@
echo #ifndef C_INSTALL_CC >>$@
echo # define C_INSTALL_CC "$(C_COMPILER)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_CXX >>$@
echo # define C_INSTALL_CXX "$(CXX_COMPILER)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_RC_COMPILER >>$@
echo # define C_INSTALL_RC_COMPILER "$(RC_COMPILER)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_CFLAGS >>$@
echo # define C_INSTALL_CFLAGS "$(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_LDFLAGS >>$@
echo # define C_INSTALL_LDFLAGS "$(LINKER_OPTIONS) $(LINKER_OPTIMIZATION_OPTIONS)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_PREFIX >>$@
echo # define C_INSTALL_PREFIX "$(PREFIX)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_SHARE_HOME >>$@
echo # define C_INSTALL_SHARE_HOME "$(DATADIR)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_BIN_HOME >>$@
echo # define C_INSTALL_BIN_HOME "$(BINDIR)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_EGG_HOME >>$@
echo # define C_INSTALL_EGG_HOME "$(EGGDIR)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_LIB_HOME >>$@
echo # define C_INSTALL_LIB_HOME "$(LIBDIR)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_LIB_NAME >>$@
echo # define C_INSTALL_LIB_NAME "$(INSTALL_LIB_NAME)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_STATIC_LIB_HOME >>$@
echo # define C_INSTALL_STATIC_LIB_HOME "$(LIBDIR)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_INCLUDE_HOME >>$@
echo # define C_INSTALL_INCLUDE_HOME "$(INCDIR)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_MORE_LIBS >>$@
echo # define C_INSTALL_MORE_LIBS "$(LIBRARIES)" >>$@
echo #endif >>$@
echo #ifndef C_INSTALL_MORE_STATIC_LIBS >>$@
echo # define C_INSTALL_MORE_STATIC_LIBS "$(LIBRARIES)" >>$@
echo #endif >>$@
echo #ifndef C_DEFAULT_TARGET_STACK_SIZE >>$@
echo # define C_DEFAULT_TARGET_STACK_SIZE $(NURSERY) >>$@
echo #endif >>$@
echo #ifndef C_DEFAULT_TARGET_HEAP_SIZE >>$@
echo # define C_DEFAULT_TARGET_HEAP_SIZE 0 >>$@
echo #endif >>$@
echo #ifndef C_STACK_GROWS_DOWNWARD >>$@
echo # define C_STACK_GROWS_DOWNWARD $(STACKDIRECTION) >>$@
echo #endif >>$@
echo #ifndef C_TARGET_MORE_LIBS >>$@
echo # define C_TARGET_MORE_LIBS "$(TARGET_LIBRARIES)" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_MORE_STATIC_LIBS >>$@
echo # define C_TARGET_MORE_STATIC_LIBS "$(TARGET_LIBRARIES)" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_CC >>$@
echo # define C_TARGET_CC "$(TARGET_C_COMPILER)" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_CXX >>$@
echo # define C_TARGET_CXX "$(TARGET_CXX_COMPILER)" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_RC_COMPILER >>$@
echo # define C_TARGET_RC_COMPILER "$(TARGET_RC_COMPILER)" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_CFLAGS >>$@
echo # define C_TARGET_CFLAGS "$(TARGET_C_COMPILER_OPTIONS) $(TARGET_C_COMPILER_OPTIMIZATION_OPTIONS)" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_LDFLAGS >>$@
echo # define C_TARGET_LDFLAGS "$(TARGET_LINKER_OPTIONS) $(TARGET_LINKER_OPTIMIZATION_OPTIONS)" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_FEATURES >>$@
echo # define C_TARGET_FEATURES "$(TARGET_FEATURES)" >>$@
echo #endif >>$@
echo #ifndef C_CROSS_CHICKEN >>$@
echo # define C_CROSS_CHICKEN $(CROSS_CHICKEN) >>$@
echo #endif >>$@
echo #ifndef C_TARGET_PREFIX >>$@
echo # define C_TARGET_PREFIX "$(TARGET_PREFIX)" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_BIN_HOME >>$@
echo # define C_TARGET_BIN_HOME "$(TARGET_PREFIX)/bin" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_LIB_HOME >>$@
echo # define C_TARGET_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_LIB_NAME >>$@
echo # define C_TARGET_LIB_NAME "$(TARGET_LIB_NAME)" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_RUN_LIB_HOME >>$@
echo # define C_TARGET_RUN_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_SHARE_HOME >>$@
echo # define C_TARGET_SHARE_HOME "$(TARGET_PREFIX)/share" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_INCLUDE_HOME >>$@
echo # define C_TARGET_INCLUDE_HOME "$(TARGET_PREFIX)/include/chicken" >>$@
echo #endif >>$@
echo #ifndef C_TARGET_STATIC_LIB_HOME >>$@
echo # define C_TARGET_STATIC_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
echo #endif >>$@
echo #ifndef C_CSC_PROGRAM >>$@
echo # define C_CSC_PROGRAM "$(CSC_PROGRAM)" >>$@
echo #endif >>$@
echo #ifndef C_CSI_PROGRAM >>$@
echo # define C_CSI_PROGRAM "$(CSI_PROGRAM)" >>$@
echo #endif >>$@
echo #ifndef C_CHICKEN_BUG_PROGRAM >>$@
echo # define C_CHICKEN_BUG_PROGRAM "$(CHICKEN_BUG_PROGRAM)" >>$@
echo #endif >>$@
echo #ifndef C_CHICKEN_INSTALL_PROGRAM >>$@
echo # define C_CHICKEN_INSTALL_PROGRAM "$(CHICKEN_INSTALL_PROGRAM)" >>$@
echo #endif >>$@
echo #ifndef C_CHICKEN_UNINSTALL_PROGRAM >>$@
echo # define C_CHICKEN_UNINSTALL_PROGRAM "$(CHICKEN_UNINSTALL_PROGRAM)" >>$@
echo #endif >>$@
echo #ifndef C_CHICKEN_STATUS_PROGRAM >>$@
echo # define C_CHICKEN_STATUS_PROGRAM "$(CHICKEN_STATUS_PROGRAM)" >>$@
echo #endif >>$@
echo #ifndef C_BINARY_VERSION >>$@
echo # define C_BINARY_VERSION $(BINARYVERSION) >>$@
echo #endif >>$@
echo #ifndef C_BRANCH_NAME >>$@
echo # define C_BRANCH_NAME "" >>$@
echo #endif >>$@
echo /* END OF FILE */ >>$@
chicken-install.rc:
echo /* GENERATED */ >$@
echo 1 24 MOVEABLE PURE >>$@
echo BEGIN >>$@
echo "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>\r\n" >>$@
echo "<assembly xmlns=""urn:schemas-microsoft-com:asm.v1"" manifestVersion=""1.0"">\r\n" >>$@
echo " <assemblyIdentity version=""1.0.0.0"" processorArchitecture=""*"" name=""$(PROGRAM_PREFIX)chicken-install$(PROGRAM_SUFFIX)"" type=""win32""/>\r\n" >>$@
echo " <ms_asmv2:trustInfo xmlns:ms_asmv2=""urn:schemas-microsoft-com:asm.v2"">\r\n" >>$@
echo " <ms_asmv2:security>\r\n" >>$@
echo " <ms_asmv2:requestedPrivileges>\r\n" >>$@
echo " <ms_asmv2:requestedExecutionLevel level=""asInvoker"" uiAccess=""false""/>\r\n" >>$@
echo " </ms_asmv2:requestedPrivileges>\r\n" >>$@
echo " </ms_asmv2:security>\r\n" >>$@
echo " </ms_asmv2:trustInfo>\r\n" >>$@
echo "</assembly>\r\n" >>$@
echo END >>$@
echo /* END OF FILE */ >>$@
chicken-uninstall.rc:
echo /* END OF FILE */ >$@
echo 1 24 MOVEABLE PURE >>$@
echo BEGIN >>$@
echo "<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>\r\n" >>$@
echo "<assembly xmlns=""urn:schemas-microsoft-com:asm.v1"" manifestVersion=""1.0"">\r\n" >>$@
echo " <assemblyIdentity version=""1.0.0.0"" processorArchitecture=""*"" name=""$(PROGRAM_PREFIX)chicken-uninstall$(PROGRAM_SUFFIX)"" type=""win32""/>\r\n" >>$@
echo " <ms_asmv2:trustInfo xmlns:ms_asmv2=""urn:schemas-microsoft-com:asm.v2"">\r\n" >>$@
echo " <ms_asmv2:security>\r\n" >>$@
echo " <ms_asmv2:requestedPrivileges>\r\n" >>$@
echo " <ms_asmv2:requestedExecutionLevel level=""asInvoker"" uiAccess=""false""/>\r\n" >>$@
echo " </ms_asmv2:requestedPrivileges>\r\n" >>$@
echo " </ms_asmv2:security>\r\n" >>$@
echo " </ms_asmv2:trustInfo>\r\n" >>$@
echo "</assembly>\r\n" >>$@
echo END >>$@
echo /* END OF FILE */ >>$@
include $(SRCDIR)rules.make
Jump to Line
Something went wrong with that request. Please try again.