source: project/chicken/branches/prerelease/Makefile.mingw @ 9381

Last change on this file since 9381 was 9381, checked in by Ivan Raikov, 12 years ago

Merged trunk into prerelease

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