source: project/chicken/trunk/Makefile.mingw @ 13246

Last change on this file since 13246 was 13246, checked in by felix winkelmann, 11 years ago

use --enable-auto-import on mingw

File size: 8.4 KB
Line 
1# Makefile.mingw - configuration for MinGW (no MSYS) -*- Makefile -*-
2#
3# Copyright (c) 2007, Felix L. Winkelmann
4# Copyright (c) 2008-2009, The Chicken Team
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
27
28SEP = \\
29SRCDIR =.$(SEP)
30
31# platform configuration
32
33DLLSINPATH = 1
34ARCH = x86
35HACKED_APPLY = 1
36WINDOWS = 1
37WINDOWS_SHELL = 1
38UNAME_SYS = MinGW
39
40# file extensions
41
42SO = .dll
43EXE = .exe
44
45# options
46
47C_COMPILER ?= gcc
48C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H
49ifdef DEBUGBUILD
50C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
51else
52C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os
53endif
54C_COMPILER_SHARED_OPTIONS = -DPIC
55C_COMPILER_GUI_RUNTIME_OPTIONS = -DC_WINDOWS_GUI
56LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared
57LIBRARIES = -lm -lws2_32
58LINKER_OPTIONS = -Wl,--enable-auto-import
59LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libchicken.dll.a
60LIBUCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libuchicken.dll.a
61LIBCHICKENGUI_SO_LINKER_OPTIONS = -Wl,--out-implib,libchickengui.dll.a
62LIBCHICKEN_SO_LIBRARIES = -lm -lws2_32
63LIBUCHICKEN_SO_LIBRARIES = -lm -lws2_32
64LIBCHICKENGUI_SO_LIBRARIES = -lm -lkernel32 -luser32 -lgdi32 -lws2_32
65LIBCHICKENGUI_IMPORT_LIBRARY = libchickengui.dll.a
66LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a
67LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a
68MAKEDIR_COMMAND_OPTIONS =
69
70# special files
71
72CHICKEN_CONFIG_H = chicken-config.h
73APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O)
74POSIXFILE = posixwin
75
76# select default and internal settings
77
78CUSTOM_CHICKEN_DEFAULTS=1
79
80include $(SRCDIR)defaults.make
81
82# main target
83
84all: libchicken$(A) libuchicken$(A) chicken$(EXE) csi$(EXE) chicken-profile$(EXE) \
85        csc$(EXE) libchicken$(SO) \
86        libuchicken$(SO) libchickengui$(SO) libchickengui$(A) chicken-install$(EXE) \
87        chicken-status$(EXE) chicken-uninstall$(EXE) chicken.info
88
89chicken-config.h: chicken-defaults.h
90        echo #define HAVE_DIRENT_H 1 >$@
91        echo #define HAVE_INTTYPES_H 1 >>$@
92        echo #define HAVE_LIMITS_H 1 >>$@
93        echo #define HAVE_LONG_LONG 1 >>$@
94        echo #define HAVE_MEMMOVE 1 >>$@
95        echo #define HAVE_MEMORY_H 1 >>$@
96        echo #define HAVE_STDINT_H 1 >>$@
97        echo #define HAVE_STDLIB_H 1 >>$@
98        echo #define HAVE_STRERROR 1 >>$@
99        echo #define HAVE_STRINGS_H 1 >>$@
100        echo #define HAVE_STRING_H 1 >>$@
101        echo #define HAVE_STRTOLL 1 >>$@
102        echo #define HAVE_SYS_STAT_H 1 >>$@
103        echo #define HAVE_SYS_TYPES_H 1 >>$@
104        echo #define HAVE_UNISTD_H 1 >>$@
105        echo #define HAVE_UNSIGNED_LONG_LONG 1 >>$@
106        echo #define HAVE_WINDOWS_H 1 >>$@
107        echo #define HAVE__STRTOI64 1 >>$@
108        echo #define STDC_HEADERS 1 >>$@
109        echo #define HAVE_ALLOCA_H 1 >>$@
110        echo #define HAVE_DIRECT_H 1 >>$@
111        echo #define HAVE_ERRNO_H 1 >>$@
112        echo #define HAVE_GCVT 1 >>$@
113        echo #define HAVE_LOADLIBRARY 1 >>$@
114        echo #define HAVE_GETPROCADDRESS 1 >>$@
115        echo #define HAVE_WINSOCK2_H 1 >>$@
116        echo #define HAVE_WS2TCPIP_H 1 >>$@
117        echo #define C_STACK_GROWS_DOWNWARD 1 >>$@
118ifdef GCHOOKS
119        echo #define C_GC_HOOKS >>$@
120endif
121ifdef SYMBOLGC
122        echo #define C_COLLECT_ALL_SYMBOLS >>$@
123endif
124ifdef NOAPPLYHOOK
125        echo #define C_NO_APPLY_HOOK >>$@
126endif
127        echo #define C_HACKED_APPLY >>$@
128        type chicken-defaults.h >>$@
129
130chicken-defaults.h:
131        echo /* generated */ >$@
132        echo #define C_BUILD_TAG "$(BUILD_TAG)" >>$@
133        echo #define C_CHICKEN_PROGRAM "$(CHICKEN_PROGRAM)$(EXE)" >>$@
134        echo #define C_WINDOWS_SHELL 1 >>$@
135        echo #ifndef C_INSTALL_CC >>$@
136        echo # define C_INSTALL_CC "$(C_COMPILER)" >>$@
137        echo #endif >>$@
138        echo #ifndef C_INSTALL_CXX >>$@
139        echo # define C_INSTALL_CXX "$(CXX_COMPILER)" >>$@
140        echo #endif >>$@
141        echo #ifndef C_INSTALL_CFLAGS >>$@
142        echo # define C_INSTALL_CFLAGS "$(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS)" >>$@
143        echo #endif >>$@
144        echo #ifndef C_INSTALL_LDFLAGS >>$@
145        echo # define C_INSTALL_LDFLAGS "$(LINKER_OPTIONS) $(LINKER_OPTIMIZATION_OPTIONS)" >>$@
146        echo #endif >>$@
147        echo #ifndef C_INSTALL_SHARE_HOME >>$@
148        echo # define C_INSTALL_SHARE_HOME "$(DATADIR)" >>$@
149        echo #endif >>$@
150        echo #ifndef C_INSTALL_BIN_HOME >>$@
151        echo # define C_INSTALL_BIN_HOME "$(BINDIR)" >>$@
152        echo #endif >>$@
153        echo #ifndef C_INSTALL_EGG_HOME >>$@
154        echo # define C_INSTALL_EGG_HOME "$(EGGDIR)" >>$@
155        echo #endif >>$@
156        echo #ifndef C_INSTALL_LIB_HOME >>$@
157        echo # define C_INSTALL_LIB_HOME "$(LIBDIR)" >>$@
158        echo #endif >>$@
159        echo #ifndef C_INSTALL_STATIC_LIB_HOME >>$@
160        echo # define C_INSTALL_STATIC_LIB_HOME "$(LIBDIR)" >>$@
161        echo #endif >>$@
162        echo #ifndef C_INSTALL_INCLUDE_HOME >>$@
163        echo # define C_INSTALL_INCLUDE_HOME "$(INCDIR)" >>$@
164        echo #endif >>$@
165        echo #ifndef C_INSTALL_MORE_LIBS >>$@
166        echo # define C_INSTALL_MORE_LIBS "$(LIBRARIES)" >>$@
167        echo #endif >>$@
168        echo #ifndef C_INSTALL_MORE_STATIC_LIBS >>$@
169        echo # define C_INSTALL_MORE_STATIC_LIBS "$(LIBRARIES)" >>$@
170        echo #endif >>$@
171        echo #ifndef C_DEFAULT_TARGET_STACK_SIZE >>$@
172        echo # define C_DEFAULT_TARGET_STACK_SIZE $(NURSERY) >>$@
173        echo #endif >>$@
174        echo #ifndef C_DEFAULT_TARGET_HEAP_SIZE >>$@
175        echo # define C_DEFAULT_TARGET_HEAP_SIZE 0 >>$@
176        echo #endif >>$@
177        echo #ifndef C_STACK_GROWS_DOWNWARD >>$@
178        echo # define C_STACK_GROWS_DOWNWARD $(STACKDIRECTION) >>$@
179        echo #endif >>$@
180        echo #ifndef C_TARGET_MORE_LIBS >>$@
181        echo # define C_TARGET_MORE_LIBS "$(TARGET_LIBRARIES)" >>$@
182        echo #endif >>$@
183        echo #ifndef C_TARGET_MORE_STATIC_LIBS >>$@
184        echo # define C_TARGET_MORE_STATIC_LIBS "$(TARGET_LIBRARIES)" >>$@
185        echo #endif >>$@
186        echo #ifndef C_TARGET_CC >>$@
187        echo # define C_TARGET_CC "$(TARGET_C_COMPILER)" >>$@
188        echo #endif >>$@
189        echo #ifndef C_TARGET_CXX >>$@
190        echo # define C_TARGET_CXX "$(TARGET_CXX_COMPILER)" >>$@
191        echo #endif >>$@
192        echo #ifndef C_TARGET_CFLAGS >>$@
193        echo # define C_TARGET_CFLAGS "$(TARGET_C_COMPILER_OPTIONS) $(TARGET_C_COMPILER_OPTIMIZATION_OPTIONS)" >>$@
194        echo #endif >>$@
195        echo #ifndef C_TARGET_LDFLAGS >>$@
196        echo # define C_TARGET_LDFLAGS "$(TARGET_LINKER_OPTIONS) $(TARGET_LINKER_OPTIMIZATION_OPTIONS)" >>$@
197        echo #endif >>$@
198        echo #ifndef C_CROSS_CHICKEN >>$@
199        echo # define C_CROSS_CHICKEN $(CROSS_CHICKEN) >>$@
200        echo #endif >>$@
201        echo #ifndef C_TARGET_BIN_HOME >>$@
202        echo # define C_TARGET_BIN_HOME "$(TARGET_PREFIX)/bin" >>$@
203        echo #endif >>$@
204        echo #ifndef C_TARGET_LIB_HOME >>$@
205        echo # define C_TARGET_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
206        echo #endif >>$@
207        echo #ifndef C_TARGET_RUN_LIB_HOME >>$@
208        echo # define C_TARGET_RUN_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
209        echo #endif >>$@
210        echo #ifndef C_TARGET_SHARE_HOME >>$@
211        echo # define C_TARGET_SHARE_HOME "$(TARGET_PREFIX)/share" >>$@
212        echo #endif >>$@
213        echo #ifndef C_TARGET_INCLUDE_HOME >>$@
214        echo # define C_TARGET_INCLUDE_HOME "$(TARGET_PREFIX)/include" >>$@
215        echo #endif >>$@
216        echo #ifndef C_TARGET_STATIC_LIB_HOME >>$@
217        echo # define C_TARGET_STATIC_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
218        echo #endif >>$@
219        echo #ifndef C_CSC_PROGRAM" >>$@
220        echo # define C_CSC_PROGRAM "$(CSC_PROGRAM)" >>$@
221        echo #endif" >>$@
222        echo #ifndef C_CSI_PROGRAM" >>$@
223        echo # define C_CSI_PROGRAM "$(CSI_PROGRAM)" >>$@
224        echo #endif" >>$@
225        echo #ifndef C_CHICKEN_BUG_PROGRAM" >>$@
226        echo # define C_CHICKEN_BUG_PROGRAM "$(CHICKEN_BUG_PROGRAM)" >>$@
227        echo #endif" >>$@
228        echo #ifndef C_BINARY_VERSION >>$@
229        echo # define C_BINARY_VERSION $(BINARYVERSION) >>$@
230        echo #endif >>$@
231
232include $(SRCDIR)rules.make
Note: See TracBrowser for help on using the repository browser.