source: project/chicken/branches/chicken-3/Makefile.mingw @ 13407

Last change on this file since 13407 was 13407, checked in by elf, 11 years ago

fixing the makefile for mingw again. please stop changing it back. fix the
crosscompilation script instead of reverting the changes, so people who arent
crosscompiling can actually build chicken.
fixed C_TARGET_MORE_LIBS definition.
chicken-setup currently broken on mingw.

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