source: project/chicken/branches/hygienic/Makefile.cygwin @ 11646

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

merged with trunk rev. 11635; compiler bugfix; added files import lib

File size: 8.1 KB
Line 
1# Makefile.cygwin - configuration for Linux -*- 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 = .
29VPATH  = $(SRCDIR)
30
31# platform configuration
32
33ARCH = x86
34HACKED_APPLY=1
35DLLSINPATH = 1
36
37# options
38
39SO = .dll
40EXE = .exe
41
42C_COMPILER = gcc
43CXX_COMPILER = g++
44LINKER = gcc
45
46
47C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H
48ifdef DEBUGBUILD
49C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
50else
51C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os
52endif
53C_COMPILER_SHARED_OPTIONS = -DPIC
54LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared
55LINKER_LINK_SHARED_PROGRAM_OPTIONS = -Wl,--dll-search-prefix=cyg -Wl,--export-dynamic
56LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libchicken.dll.a \
57        -Wl,--export-all-symbols \
58        -Wl,--enable-auto-import \
59        -Wl,--image-base=0x10000000 \
60        -Wl,--dll \
61        -Wl,--add-stdcall-alias \
62        -Wl,--no-whole-archive
63LIBUCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libuchicken.dll.a \
64        -Wl,--export-all-symbols \
65        -Wl,--enable-auto-import \
66        -Wl,--image-base=0x10000000 \
67        -Wl,--dll \
68        -Wl,--add-stdcall-alias \
69        -Wl,--no-whole-archive
70
71LIBRARIES = -lm
72LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a
73LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a
74
75
76# special files
77
78CHICKEN_CONFIG_H = chicken-config.h
79APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O)
80
81# select default and internal settings
82
83CUSTOM_CHICKEN_DEFAULTS=1
84include $(SRCDIR)/defaults.make
85
86LIBCHICKEN_SO_LIBRARIES = $(LIBRARIES)
87LIBUCHICKEN_SO_LIBRARIES = $(LIBRARIES)
88
89chicken-config.h: chicken-defaults.h buildsvnrevision
90        echo "#define C_SVN_REVISION $(shell cat buildsvnrevision)" >$@
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_STRTOQ 1" >>$@
104        echo "#define HAVE_SYS_STAT_H 1" >>$@
105        echo "#define HAVE_SYS_TYPES_H 1" >>$@
106        echo "#define HAVE_UNISTD_H 1" >>$@
107        echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
108        echo "#define STDC_HEADERS 1" >>$@
109        echo "#define HAVE_ALLOCA 1" >>$@
110        echo "#define HAVE_ALLOCA_H 1" >>$@
111        echo "#define HAVE_GRP_H 1" >>$@
112        echo "#define HAVE_ERRNO_H 1" >>$@
113        echo "#define HAVE_GCVT 1" >>$@
114        echo "#define HAVE_SYSEXITS_H 1" >>$@
115        echo "#define HAVE_DLFCN_H 1" >>$@
116        echo "#define C_STACK_GROWS_DOWNWARD 1" >>$@
117ifdef GCHOOKS
118        echo "#define C_GC_HOOKS" >>$@
119endif
120ifdef SYMBOLGC
121        echo "#define C_COLLECT_ALL_SYMBOLS" >>$@
122endif
123ifdef NOAPPLYHOOK
124        echo "#define C_NO_APPLY_HOOK" >>$@
125endif
126ifdef HACKED_APPLY
127        echo "#define C_HACKED_APPLY" >>$@
128endif
129        cat 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 \"$(BINDIR)\"" >>$@
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)/bin\"" >>$@
199        echo "#endif" >>$@
200        echo "#ifndef C_TARGET_RUN_LIB_HOME" >>$@
201        echo "# define C_TARGET_RUN_LIB_HOME \"$(TARGET_RUN_PREFIX)/bin\"" >>$@
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        echo "#ifndef C_CHICKEN_PROGRAM" >>$@
213        echo "# define C_CHICKEN_PROGRAM \"$(CHICKEN_PROGRAM)\"" >>$@
214        echo "#endif" >>$@
215        echo "#ifndef C_CSC_PROGRAM" >>$@
216        echo "# define C_CSC_PROGRAM \"$(CSC_PROGRAM)\"" >>$@
217        echo "#endif" >>$@
218        echo "#ifndef C_CSI_PROGRAM" >>$@
219        echo "# define C_CSI_PROGRAM \"$(CSI_PROGRAM)\"" >>$@
220        echo "#endif" >>$@
221        echo "#ifndef C_CHICKEN_BUG_PROGRAM" >>$@
222        echo "# define C_CHICKEN_BUG_PROGRAM \"$(CHICKEN_BUG_PROGRAM)\"" >>$@
223        echo "#endif" >>$@
224
225include $(SRCDIR)/rules.make
Note: See TracBrowser for help on using the repository browser.