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

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

integrated setup tools into build (optional); some enhancements, mostly untested

File size: 8.0 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
28# platform configuration
29
30ARCH = x86
31HACKED_APPLY=1
32
33# options
34
35SO = .dll
36EXE = .exe
37
38C_COMPILER = gcc
39CXX_COMPILER = g++
40LINKER = gcc
41
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
50LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared
51LINKER_LINK_SHARED_PROGRAM_OPTIONS = -Wl,--dll-search-prefix=cyg -Wl,--export-dynamic
52LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libchicken.dll.a \
53        -Wl,--export-all-symbols \
54        -Wl,--enable-auto-import \
55        -Wl,--image-base=0x10000000 \
56        -Wl,--dll \
57        -Wl,--add-stdcall-alias \
58        -Wl,--no-whole-archive
59LIBUCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libuchicken.dll.a \
60        -Wl,--export-all-symbols \
61        -Wl,--enable-auto-import \
62        -Wl,--image-base=0x10000000 \
63        -Wl,--dll \
64        -Wl,--add-stdcall-alias \
65        -Wl,--no-whole-archive
66
67LIBRARIES = -lm
68LIBCHICKEN_SO_LIBRARIES = -lm
69LIBUCHICKEN_SO_LIBRARIES = -lm
70LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a
71LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a
72
73
74# special files
75
76CHICKEN_CONFIG_H = chicken-config.h
77APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O)
78
79# select default and internal settings
80
81CUSTOM_CHICKEN_DEFAULTS=1
82include defaults.make
83
84chicken-config.h: chicken-defaults.h buildsvnrevision
85        echo "#define C_SVN_REVISION $(shell cat buildsvnrevision)" >$@
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_STRTOQ 1" >>$@
99        echo "#define HAVE_SYS_STAT_H 1" >>$@
100        echo "#define HAVE_SYS_TYPES_H 1" >>$@
101        echo "#define HAVE_UNISTD_H 1" >>$@
102        echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
103        echo "#define STDC_HEADERS 1" >>$@
104        echo "#define HAVE_ALLOCA 1" >>$@
105        echo "#define HAVE_ALLOCA_H 1" >>$@
106        echo "#define HAVE_GRP_H 1" >>$@
107        echo "#define HAVE_ERRNO_H 1" >>$@
108        echo "#define HAVE_GCVT 1" >>$@
109        echo "#define HAVE_SYSEXITS_H 1" >>$@
110        echo "#define HAVE_DLFCN_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
121ifdef HACKED_APPLY
122        echo "#define C_HACKED_APPLY" >>$@
123endif
124        cat 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 \"$(DATADIR)\"" >>$@
143        echo "#endif" >>$@
144        echo "#ifndef C_INSTALL_BIN_HOME" >>$@
145        echo "# define C_INSTALL_BIN_HOME \"$(BINDIR)\"" >>$@
146        echo "#endif" >>$@
147        echo "#ifndef C_INSTALL_EGG_HOME" >>$@
148        echo "# define C_INSTALL_EGG_HOME \"$(EGGDIR)\"" >>$@
149        echo "#endif" >>$@
150        echo "#ifndef C_INSTALL_LIB_HOME" >>$@
151        echo "# define C_INSTALL_LIB_HOME \"$(BINDIR)\"" >>$@
152        echo "#endif" >>$@
153        echo "#ifndef C_INSTALL_STATIC_LIB_HOME" >>$@
154        echo "# define C_INSTALL_STATIC_LIB_HOME \"$(LIBDIR)\"" >>$@
155        echo "#endif" >>$@
156        echo "#ifndef C_INSTALL_INCLUDE_HOME" >>$@
157        echo "# define C_INSTALL_INCLUDE_HOME \"$(INCDIR)\"" >>$@
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_RUN_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_CHICKEN_PROGRAM" >>$@
208        echo "# define C_CHICKEN_PROGRAM \"$(CHICKEN_PROGRAM)\"" >>$@
209        echo "#endif" >>$@
210        echo "#ifndef C_CSC_PROGRAM" >>$@
211        echo "# define C_CSC_PROGRAM \"$(CSC_PROGRAM)\"" >>$@
212        echo "#endif" >>$@
213        echo "#ifndef C_CSI_PROGRAM" >>$@
214        echo "# define C_CSI_PROGRAM \"$(CSI_PROGRAM)\"" >>$@
215        echo "#endif" >>$@
216        echo "#ifndef C_CHICKEN_BUG_PROGRAM" >>$@
217        echo "# define C_CHICKEN_BUG_PROGRAM \"$(CHICKEN_BUG_PROGRAM)\"" >>$@
218        echo "#endif" >>$@
219
220include rules.make
Note: See TracBrowser for help on using the repository browser.