~ chicken-core (chicken-5) /Makefile.mingw
Trap1# Makefile.mingw - configuration for MinGW (no MSYS) -*- Makefile -*-
2#
3# Copyright (c) 2008-2022, The CHICKEN Team
4# Copyright (c) 2007, Felix L. Winkelmann
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
8# conditions are met:
9#
10# Redistributions of source code must retain the above copyright notice, this list of conditions and the following
11# disclaimer.
12# Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
13# disclaimer in the documentation and/or other materials provided with the distribution.
14# Neither the name of the author nor the names of its contributors may be used to endorse or promote
15# products derived from this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
18# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
19# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
20# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25# POSSIBILITY OF SUCH DAMAGE.
26
27SEP = $(strip \)
28SRCDIR ?= .$(SEP)
29
30# platform configuration
31
32DLLSINPATH = 1
33ARCH ?= x86
34WINDOWS = 1
35WINDOWS_SHELL = 1
36UNAME_SYS = MinGW
37
38# file extensions
39
40SO = .dll
41EXE = .exe
42
43# options
44
45C_COMPILER ?= gcc
46C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H
47ifdef DEBUGBUILD
48C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
49else
50ifdef OPTIMIZE_FOR_SPEED
51C_COMPILER_OPTIMIZATION_OPTIONS ?= -O3
52else
53C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os
54endif
55endif
56C_COMPILER_SHARED_OPTIONS = -DPIC
57RC_COMPILER ?= windres
58LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared
59LIBRARIES = -lm -lws2_32
60LINKER_OPTIONS += -Wl,--enable-auto-import
61LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX).dll.a
62LIBCHICKEN_SO_LIBRARIES = -lm -lws2_32
63LIBCHICKEN_IMPORT_LIBRARY = lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX).dll.a
64MAKEDIR_COMMAND_OPTIONS =
65GENERATE_DEBUGGER = type $< >$@ & echo wish $(DATADIR)\feathers.tcl %1 %2 %3 %4 %5 %6 %7 %8 %9 >>$@
66
67# special files
68
69CHICKEN_CONFIG_H = chicken-config.h
70POSIXFILE = posixwin
71
72# select default and internal settings
73
74include $(SRCDIR)defaults.make
75
76chicken-config.h: chicken-defaults.h
77 echo /* GENERATED */ >$@
78 echo #define HAVE_DIRENT_H 1 >>$@
79 echo #define HAVE_INTTYPES_H 1 >>$@
80 echo #define HAVE_LIMITS_H 1 >>$@
81 echo #define HAVE_LONG_LONG 1 >>$@
82 echo #define HAVE_MEMMOVE 1 >>$@
83 echo #define HAVE_MEMORY_H 1 >>$@
84 echo #define NO_POSIX_POLL 1 >>$@
85 echo #define HAVE_STDINT_H 1 >>$@
86 echo #define HAVE_STDLIB_H 1 >>$@
87 echo #define HAVE_STRERROR 1 >>$@
88 echo #define HAVE_STRINGS_H 1 >>$@
89 echo #define HAVE_STRING_H 1 >>$@
90 echo #define HAVE_STRTOLL 1 >>$@
91 echo #define HAVE_SYS_STAT_H 1 >>$@
92 echo #define HAVE_SYS_TYPES_H 1 >>$@
93 echo #define HAVE_UNISTD_H 1 >>$@
94 echo #define HAVE_UNSIGNED_LONG_LONG 1 >>$@
95 echo #define STDC_HEADERS 1 >>$@
96 echo #define HAVE_DIRECT_H 1 >>$@
97 echo #define HAVE_ERRNO_H 1 >>$@
98 echo #define HAVE_LOADLIBRARY 1 >>$@
99 echo #define HAVE_GETPROCADDRESS 1 >>$@
100 echo #define C_STACK_GROWS_DOWNWARD 1 >>$@
101ifdef GCHOOKS
102 echo #define C_GC_HOOKS >>$@
103endif
104 echo #define C_USE_STD_FEATURE_MACROS >>$@
105 type chicken-defaults.h >>$@
106
107include $(SRCDIR)rules.make