source: project/chicken/branches/release/Makefile.mingw @ 7276

Last change on this file since 7276 was 7276, checked in by felix winkelmann, 12 years ago

merged trunk

File size: 7.6 KB
Line 
1# Makefile.mingw - configuration for MinGW (no MSYS) -*- Makefile -*-
2#
3# Copyright (c) 2007, Felix L. Winkelmann
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
7# conditions are met:
8#
9#   Redistributions of source code must retain the above copyright notice, this list of conditions and the following
10#     disclaimer.
11#   Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
12#     disclaimer in the documentation and/or other materials provided with the distribution.
13#   Neither the name of the author nor the names of its contributors may be used to endorse or promote
14#     products derived from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
17# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
18# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
19# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24# POSSIBILITY OF SUCH DAMAGE.
25#
26# Send bugs, suggestions and ideas to:
27#
28# felix@call-with-current-continuation.org
29#
30# Felix L. Winkelmann
31# Unter den Gleichen 1
32# 37130 Gleichen
33# Germany
34
35
36# platform configuration
37
38DLLSINPATH = 1
39ARCH = x86
40HACKED_APPLY = 1
41WINDOWS = 1
42
43# file extensions
44
45SO = .dll
46EXE = .exe
47
48# options
49
50C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H
51ifdef DEBUGBUILD
52C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
53else
54C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os
55endif
56C_COMPILER_SHARED_OPTIONS = -DPIC
57C_COMPILER_GUI_RUNTIME_OPTIONS = -DC_WINDOWS_GUI
58LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared
59LIBRARIES = -lm -lws2_32
60LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libchicken.dll.a
61LIBUCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libuchicken.dll.a
62LIBCHICKENGUI_SO_LINKER_OPTIONS = -Wl,--out-implib,libchickengui.dll.a
63LIBCHICKEN_SO_LIBRARIES = -lm -lws2_32
64LIBUCHICKEN_SO_LIBRARIES = -lm -lws2_32
65LIBCHICKENGUI_SO_LIBRARIES = -lm -lkernel32 -luser32 -lgdi32 -lws2_32
66LIBCHICKENGUI_IMPORT_LIBRARY = libchickengui.dll.a
67LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a
68LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a
69MAKEDIR_COMMAND_OPTIONS =
70
71# special files
72
73CHICKEN_CONFIG_H = chicken-config.h
74APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O)
75POSIXFILE = posixwin
76
77# select default and internal settings
78
79CUSTOM_CHICKEN_DEFAULTS=1
80
81include defaults.make
82
83# main target
84
85all: libchicken$(A) libuchicken$(A) chicken$(EXE) csi$(EXE) chicken-profile$(EXE) \
86        csc$(EXE) libchicken$(SO) \
87        libuchicken$(SO) libchickengui$(SO) libchickengui$(A) chicken-setup$(EXE) \
88        chicken.info
89
90chicken-config.h: chicken-defaults.h
91        echo #define HAVE_DIRENT_H 1 >>$@
92        echo #define HAVE_INTTYPES_H 1 >>$@
93        echo #define HAVE_LIMITS_H 1 >>$@
94        echo #define HAVE_LONG_LONG 1 >>$@
95        echo #define HAVE_MEMMOVE 1 >>$@
96        echo #define HAVE_MEMORY_H 1 >>$@
97        echo #define HAVE_STDINT_H 1 >>$@
98        echo #define HAVE_STDLIB_H 1 >>$@
99        echo #define HAVE_STRERROR 1 >>$@
100        echo #define HAVE_STRINGS_H 1 >>$@
101        echo #define HAVE_STRING_H 1 >>$@
102        echo #define HAVE_STRTOLL 1 >>$@
103        echo #define HAVE_SYS_STAT_H 1 >>$@
104        echo #define HAVE_SYS_TYPES_H 1 >>$@
105        echo #define HAVE_UNISTD_H 1 >>$@
106        echo #define HAVE_UNSIGNED_LONG_LONG 1 >>$@
107        echo #define HAVE_WINDOWS_H 1 >>$@
108        echo #define HAVE__STRTOI64 1 >>$@
109        echo #define STDC_HEADERS 1 >>$@
110        echo #define HAVE_ALLOCA_H 1 >>$@
111        echo #define HAVE_DIRECT_H 1 >>$@
112        echo #define HAVE_ERRNO_H 1 >>$@
113        echo #define HAVE_GCVT 1 >>$@
114        echo #define HAVE_LOADLIBRARY 1 >>$@
115        echo #define HAVE_GETPROCADDRESS 1 >>$@
116        echo #define HAVE_WINSOCK2_H 1 >>$@
117        echo #define HAVE_WS2TCPIP_H 1 >>$@
118        echo #define C_STACK_GROWS_DOWNWARD 1 >>$@
119ifdef GCHOOKS
120        echo #define C_GC_HOOKS >>$@
121endif
122ifdef SYMBOLGC
123        echo #define C_COLLECT_ALL_SYMBOLS >>$@
124endif
125ifdef NOAPPLYHOOK
126        echo #define C_NO_APPLY_HOOK >>$@
127endif
128        echo #define C_HACKED_APPLY >>$@
129        type chicken-defaults.h >>$@
130
131chicken-defaults.h:
132        echo /* generated */ >$@
133        echo #define C_BUILD_TAG "$(BUILD_TAG)" >>$@
134        echo #ifndef C_INSTALL_CC >>$@
135        echo # define C_INSTALL_CC "$(C_COMPILER)" >>$@
136        echo #endif >>$@
137        echo #ifndef C_INSTALL_CXX >>$@
138        echo # define C_INSTALL_CXX "$(CXX_COMPILER)" >>$@
139        echo #endif >>$@
140        echo #ifndef C_INSTALL_CFLAGS >>$@
141        echo # define C_INSTALL_CFLAGS "$(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS)" >>$@
142        echo #endif >>$@
143        echo #ifndef C_INSTALL_LDFLAGS >>$@
144        echo # define C_INSTALL_LDFLAGS "$(LINKER_OPTIONS) $(LINKER_OPTIMIZATION_OPTIONS)" >>$@
145        echo #endif >>$@
146        echo #ifndef C_INSTALL_SHARE_HOME >>$@
147        echo # define C_INSTALL_SHARE_HOME "$(DATADIR)" >>$@
148        echo #endif >>$@
149        echo #ifndef C_INSTALL_BIN_HOME >>$@
150        echo # define C_INSTALL_BIN_HOME "$(BINDIR)" >>$@
151        echo #endif >>$@
152        echo #ifndef C_INSTALL_EGG_HOME >>$@
153        echo # define C_INSTALL_EGG_HOME "$(EGGDIR)" >>$@
154        echo #endif >>$@
155        echo #ifndef C_INSTALL_LIB_HOME >>$@
156        echo # define C_INSTALL_LIB_HOME "$(LIBDIR)" >>$@
157        echo #endif >>$@
158        echo #ifndef C_INSTALL_STATIC_LIB_HOME >>$@
159        echo # define C_INSTALL_STATIC_LIB_HOME "$(LIBDIR)" >>$@
160        echo #endif >>$@
161        echo #ifndef C_INSTALL_INCLUDE_HOME >>$@
162        echo # define C_INSTALL_INCLUDE_HOME "$(INCDIR)" >>$@
163        echo #endif >>$@
164        echo #ifndef C_INSTALL_MORE_LIBS >>$@
165        echo # define C_INSTALL_MORE_LIBS "$(LIBRARIES)" >>$@
166        echo #endif >>$@
167        echo #ifndef C_INSTALL_MORE_STATIC_LIBS >>$@
168        echo # define C_INSTALL_MORE_STATIC_LIBS "$(LIBRARIES)" >>$@
169        echo #endif >>$@
170        echo #ifndef C_DEFAULT_TARGET_STACK_SIZE >>$@
171        echo # define C_DEFAULT_TARGET_STACK_SIZE $(NURSERY) >>$@
172        echo #endif >>$@
173        echo #ifndef C_STACK_GROWS_DOWNWARD >>$@
174        echo # define C_STACK_GROWS_DOWNWARD $(STACKDIRECTION) >>$@
175        echo #endif >>$@
176        echo #ifndef C_TARGET_MORE_LIBS >>$@
177        echo # define C_TARGET_MORE_LIBS "$(TARGET_LIBRARIES)" >>$@
178        echo #endif >>$@
179        echo #ifndef C_TARGET_MORE_STATIC_LIBS >>$@
180        echo # define C_TARGET_MORE_STATIC_LIBS "$(TARGET_LIBRARIES)" >>$@
181        echo #endif >>$@
182        echo #ifndef C_TARGET_CC >>$@
183        echo # define C_TARGET_CC "$(TARGET_C_COMPILER)" >>$@
184        echo #endif >>$@
185        echo #ifndef C_TARGET_CXX >>$@
186        echo # define C_TARGET_CXX "$(TARGET_CXX_COMPILER)" >>$@
187        echo #endif >>$@
188        echo #ifndef C_TARGET_CFLAGS >>$@
189        echo # define C_TARGET_CFLAGS "$(TARGET_C_COMPILER_OPTIONS) $(TARGET_C_COMPILER_OPTIMIZATION_OPTIONS)" >>$@
190        echo #endif >>$@
191        echo #ifndef C_TARGET_LDFLAGS >>$@
192        echo # define C_TARGET_LDFLAGS "$(TARGET_LINKER_OPTIONS) $(TARGET_LINKER_OPTIMIZATION_OPTIONS)" >>$@
193        echo #endif >>$@
194        echo #ifndef C_CROSS_CHICKEN >>$@
195        echo # define C_CROSS_CHICKEN $(CROSS_CHICKEN) >>$@
196        echo #endif >>$@
197        echo #ifndef C_TARGET_LIB_HOME >>$@
198        echo # define C_TARGET_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
199        echo #endif >>$@
200        echo #ifndef C_TARGET_RUN_LIB_HOME >>$@
201        echo # define C_TARGET_RUN_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
202        echo #endif >>$@
203        echo #ifndef C_TARGET_SHARE_HOME >>$@
204        echo # define C_TARGET_SHARE_HOME "$(TARGET_PREFIX)/share" >>$@
205        echo #endif >>$@
206        echo #ifndef C_TARGET_INCLUDE_HOME >>$@
207        echo # define C_TARGET_INCLUDE_HOME "$(TARGET_PREFIX)/include" >>$@
208        echo #endif >>$@
209        echo #ifndef C_TARGET_STATIC_LIB_HOME >>$@
210        echo # define C_TARGET_STATIC_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
211        echo #endif >>$@
212
213include rules.make
Note: See TracBrowser for help on using the repository browser.