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

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

merged trunk

File size: 8.4 KB
Line 
1# Makefile.cygwin - configuration for Linux -*- 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
38ARCH = x86
39HACKED_APPLY=1
40
41# options
42
43SO = .dll
44EXE = .exe
45
46C_COMPILER = gcc
47CXX_COMPILER = g++
48LINKER = gcc
49
50
51C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H
52ifdef DEBUGBUILD
53C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
54else
55C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os
56endif
57C_COMPILER_SHARED_OPTIONS = -DPIC
58LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared
59LINKER_LINK_SHARED_PROGRAM_OPTIONS = -Wl,--dll-search-prefix=cyg -Wl,--export-dynamic
60LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libchicken.dll.a \
61        -Wl,--export-all-symbols \
62        -Wl,--enable-auto-import \
63        -Wl,--image-base=0x10000000 \
64        -Wl,--dll \
65        -Wl,--add-stdcall-alias \
66        -Wl,--no-whole-archive
67LIBUCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libuchicken.dll.a \
68        -Wl,--export-all-symbols \
69        -Wl,--enable-auto-import \
70        -Wl,--image-base=0x10000000 \
71        -Wl,--dll \
72        -Wl,--add-stdcall-alias \
73        -Wl,--no-whole-archive
74
75LIBRARIES = -lm
76LIBCHICKEN_SO_LIBRARIES = -lm
77LIBUCHICKEN_SO_LIBRARIES = -lm
78LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a
79LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a
80
81
82# special files
83
84CHICKEN_CONFIG_H = chicken-config.h
85APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O)
86
87# select default and internal settings
88
89CUSTOM_CHICKEN_DEFAULTS=1
90include defaults.make
91
92chicken-config.h: chicken-defaults.h
93        echo "#define HAVE_DIRENT_H 1" >>$@
94        echo "#define HAVE_INTTYPES_H 1" >>$@
95        echo "#define HAVE_LIMITS_H 1" >>$@
96        echo "#define HAVE_LONG_LONG 1" >>$@
97        echo "#define HAVE_MEMMOVE 1" >>$@
98        echo "#define HAVE_MEMORY_H 1" >>$@
99        echo "#define HAVE_STDINT_H 1" >>$@
100        echo "#define HAVE_STDLIB_H 1" >>$@
101        echo "#define HAVE_STRERROR 1" >>$@
102        echo "#define HAVE_STRINGS_H 1" >>$@
103        echo "#define HAVE_STRING_H 1" >>$@
104        echo "#define HAVE_STRTOLL 1" >>$@
105        echo "#define HAVE_STRTOQ 1" >>$@
106        echo "#define HAVE_SYS_STAT_H 1" >>$@
107        echo "#define HAVE_SYS_TYPES_H 1" >>$@
108        echo "#define HAVE_UNISTD_H 1" >>$@
109        echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
110        echo "#define STDC_HEADERS 1" >>$@
111        echo "#define HAVE_ALLOCA 1" >>$@
112        echo "#define HAVE_ALLOCA_H 1" >>$@
113        echo "#define HAVE_GRP_H 1" >>$@
114        echo "#define HAVE_ERRNO_H 1" >>$@
115        echo "#define HAVE_GCVT 1" >>$@
116        echo "#define HAVE_SYSEXITS_H 1" >>$@
117        echo "#define HAVE_DLFCN_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
128ifdef HACKED_APPLY
129        echo "#define C_HACKED_APPLY" >>$@
130endif
131        cat chicken-defaults.h >>$@
132
133chicken-defaults.h:
134        echo "/* generated */" >$@
135        echo "#define C_BUILD_TAG \"$(BUILD_TAG)\"" >>$@
136        echo "#ifndef C_INSTALL_CC" >>$@
137        echo "# define C_INSTALL_CC \"$(C_COMPILER)\"" >>$@
138        echo "#endif" >>$@
139        echo "#ifndef C_INSTALL_CXX" >>$@
140        echo "# define C_INSTALL_CXX \"$(CXX_COMPILER)\"" >>$@
141        echo "#endif" >>$@
142        echo "#ifndef C_INSTALL_CFLAGS" >>$@
143        echo "# define C_INSTALL_CFLAGS \"$(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS)\"" >>$@
144        echo "#endif" >>$@
145        echo "#ifndef C_INSTALL_LDFLAGS" >>$@
146        echo "# define C_INSTALL_LDFLAGS \"$(LINKER_OPTIONS) $(LINKER_OPTIMIZATION_OPTIONS)\"" >>$@
147        echo "#endif" >>$@
148        echo "#ifndef C_INSTALL_SHARE_HOME" >>$@
149        echo "# define C_INSTALL_SHARE_HOME \"$(DATADIR)\"" >>$@
150        echo "#endif" >>$@
151        echo "#ifndef C_INSTALL_BIN_HOME" >>$@
152        echo "# define C_INSTALL_BIN_HOME \"$(BINDIR)\"" >>$@
153        echo "#endif" >>$@
154        echo "#ifndef C_INSTALL_EGG_HOME" >>$@
155        echo "# define C_INSTALL_EGG_HOME \"$(EGGDIR)\"" >>$@
156        echo "#endif" >>$@
157        echo "#ifndef C_INSTALL_LIB_HOME" >>$@
158        echo "# define C_INSTALL_LIB_HOME \"$(BINDIR)\"" >>$@
159        echo "#endif" >>$@
160        echo "#ifndef C_INSTALL_STATIC_LIB_HOME" >>$@
161        echo "# define C_INSTALL_STATIC_LIB_HOME \"$(LIBDIR)\"" >>$@
162        echo "#endif" >>$@
163        echo "#ifndef C_INSTALL_INCLUDE_HOME" >>$@
164        echo "# define C_INSTALL_INCLUDE_HOME \"$(INCDIR)\"" >>$@
165        echo "#endif" >>$@
166        echo "#ifndef C_INSTALL_MORE_LIBS" >>$@
167        echo "# define C_INSTALL_MORE_LIBS \"$(LIBRARIES)\"" >>$@
168        echo "#endif" >>$@
169        echo "#ifndef C_INSTALL_MORE_STATIC_LIBS" >>$@
170        echo "# define C_INSTALL_MORE_STATIC_LIBS \"$(LIBRARIES)\"" >>$@
171        echo "#endif" >>$@
172        echo "#ifndef C_DEFAULT_TARGET_STACK_SIZE" >>$@
173        echo "# define C_DEFAULT_TARGET_STACK_SIZE $(NURSERY)" >>$@
174        echo "#endif" >>$@
175        echo "#ifndef C_STACK_GROWS_DOWNWARD" >>$@
176        echo "# define C_STACK_GROWS_DOWNWARD $(STACKDIRECTION)" >>$@
177        echo "#endif" >>$@
178        echo "#ifndef C_TARGET_MORE_LIBS" >>$@
179        echo "# define C_TARGET_MORE_LIBS \"$(TARGET_LIBRARIES)\"" >>$@
180        echo "#endif" >>$@
181        echo "#ifndef C_TARGET_MORE_STATIC_LIBS" >>$@
182        echo "# define C_TARGET_MORE_STATIC_LIBS \"$(TARGET_LIBRARIES)\"" >>$@
183        echo "#endif" >>$@
184        echo "#ifndef C_TARGET_CC" >>$@
185        echo "# define C_TARGET_CC \"$(TARGET_C_COMPILER)\"" >>$@
186        echo "#endif" >>$@
187        echo "#ifndef C_TARGET_CXX" >>$@
188        echo "# define C_TARGET_CXX \"$(TARGET_CXX_COMPILER)\"" >>$@
189        echo "#endif" >>$@
190        echo "#ifndef C_TARGET_CFLAGS" >>$@
191        echo "# define C_TARGET_CFLAGS \"$(TARGET_C_COMPILER_OPTIONS) $(TARGET_C_COMPILER_OPTIMIZATION_OPTIONS)\"" >>$@
192        echo "#endif" >>$@
193        echo "#ifndef C_TARGET_LDFLAGS" >>$@
194        echo "# define C_TARGET_LDFLAGS \"$(TARGET_LINKER_OPTIONS) $(TARGET_LINKER_OPTIMIZATION_OPTIONS)\"" >>$@
195        echo "#endif" >>$@
196        echo "#ifndef C_CROSS_CHICKEN" >>$@
197        echo "# define C_CROSS_CHICKEN $(CROSS_CHICKEN)" >>$@
198        echo "#endif" >>$@
199        echo "#ifndef C_TARGET_LIB_HOME" >>$@
200        echo "# define C_TARGET_LIB_HOME \"$(TARGET_PREFIX)/bin\"" >>$@
201        echo "#endif" >>$@
202        echo "#ifndef C_TARGET_RUN_LIB_HOME" >>$@
203        echo "# define C_TARGET_RUN_LIB_HOME \"$(TARGET_RUN_PREFIX)/bin\"" >>$@
204        echo "#endif" >>$@
205        echo "#ifndef C_TARGET_SHARE_HOME" >>$@
206        echo "# define C_TARGET_SHARE_HOME \"$(TARGET_PREFIX)/share\"" >>$@
207        echo "#endif" >>$@
208        echo "#ifndef C_TARGET_INCLUDE_HOME" >>$@
209        echo "# define C_TARGET_INCLUDE_HOME \"$(TARGET_PREFIX)/include\"" >>$@
210        echo "#endif" >>$@
211        echo "#ifndef C_TARGET_STATIC_LIB_HOME" >>$@
212        echo "# define C_TARGET_STATIC_LIB_HOME \"$(TARGET_PREFIX)/lib\"" >>$@
213        echo "#endif" >>$@
214        echo "#ifndef C_CHICKEN_PROGRAM" >>$@
215        echo "# define C_CHICKEN_PROGRAM \"$(CHICKEN_PROGRAM)\"" >>$@
216        echo "#endif" >>$@
217        echo "#ifndef C_CSC_PROGRAM" >>$@
218        echo "# define C_CSC_PROGRAM \"$(CSC_PROGRAM)\"" >>$@
219        echo "#endif" >>$@
220        echo "#ifndef C_CSI_PROGRAM" >>$@
221        echo "# define C_CSI_PROGRAM \"$(CSI_PROGRAM)\"" >>$@
222        echo "#endif" >>$@
223        echo "#ifndef C_CHICKEN_PROFILE_PROGRAM" >>$@
224        echo "# define C_CHICKEN_PROFILE_PROGRAM \"$(CHICKEN_PROFILE_PROGRAM)\"" >>$@
225        echo "#endif" >>$@
226        echo "#ifndef C_CHICKEN_SETUP_PROGRAM" >>$@
227        echo "# define C_CHICKEN_SETUP_PROGRAM \"$(CHICKEN_SETUP_PROGRAM)\"" >>$@
228        echo "#endif" >>$@
229        echo "#ifndef C_CHICKEN_BUG_PROGRAM" >>$@
230        echo "# define C_CHICKEN_BUG_PROGRAM \"$(CHICKEN_BUG_PROGRAM)\"" >>$@
231        echo "#endif" >>$@
232
233include rules.make
Note: See TracBrowser for help on using the repository browser.