source: project/chicken/trunk/Makefile.msvc @ 12789

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

setup-utils removal was quite incomplete; added -ignore-repository; msvc Makefile fix (thanks to Ivan Shcheklein); lots of mindless hacking

File size: 7.6 KB
Line 
1# Makefile.msvc - configuration for MSVC -*- 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
35PREFIX = c:\\msvc-devtools
36SRCDIR = .\\
37
38# platform configuration
39
40DLLSINPATH = 1
41ARCH = x86
42HACKED_APPLY =
43WINDOWS = 1
44
45# file extensions
46
47O = .obj
48A = -static.lib
49SO = .dll
50EXE = .exe
51ASM = .c
52MANIFEST = .manifest
53
54# commands
55
56C_COMPILER = cl
57CXX_COMPILER = cl
58LINKER = link
59LIBRARIAN = lib
60
61# options
62
63C_COMPILER_OPTIONS = -nologo -wd4142 -DHAVE_CHICKEN_CONFIG_H
64C_COMPILER_STATIC_OPTIONS = -MT
65C_COMPILER_SHARED_OPTIONS = -MD -DPIC
66LINKER_OPTIONS = -nologo
67C_COMPILER_GUI_RUNTIME_OPTIONS = -DC_WINDOWS_GUI
68INCLUDES = -I.
69LIBRARIES = ws2_32.lib advapi32.lib
70
71# debug
72
73ifdef DEBUGBUILD
74C_COMPILER_OPTIONS = -nologo -MDd -DHAVE_CHICKEN_CONFIG_H
75C_COMPILER_OPTIMIZATION_OPTIONS = -Zi
76LINKER_OPTIONS += -debug
77endif
78
79# compiler-dependent output options used by rules
80
81C_COMPILER_COMPILE_OPTION = -c
82C_COMPILER_OUTPUT_OPTION = -Fo
83C_COMPILER_OUTPUT = $(C_COMPILER_OUTPUT_OPTION)$@
84
85C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS = $(C_COMPILER_BUILD_RUNTIME_OPTIONS) -DC_UNSAFE_RUNTIME
86
87# linker-dependent output options
88
89LINKER_EXECUTABLE_OPTIONS = 
90LINKER_STATIC_OPTIONS = $(LINKER_EXECUTABLE_OPTIONS)
91LINKER_OUTPUT_OPTION = -out:
92LINKER_OUTPUT = $(LINKER_OUTPUT_OPTION)$@
93LINKER_LIBRARY_OPTION =
94LINKER_LIBRARY_PREFIX = lib
95LINKER_LIBRARY_SUFFIX = .lib
96LINKER_LINK_SHARED_LIBRARY_OPTIONS = -dll
97LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -dll
98
99PROGRAM_IMPORT_LIBRARIES = chicken.lib csi.lib csc.lib chicken-setup.lib chicken-profile.lib chicken-bug.lib
100LIBCHICKEN_IMPORT_LIBRARY = libchicken.lib
101LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.lib
102LIBCHICKENGUI_IMPORT_LIBRARY = libchickengui.lib
103MSVC_CHICKEN_IMPORT_LIBRARIES = $(PROGRAM_IMPORT_LIBRARIES) $(LIBCHICKEN_IMPORT_LIBRARY) \
104                                $(LIBUCHICKEN_IMPORT_LIBRARY) $(LIBCHICKENGUI_IMPORT_LIBRARY)
105MSVC_CHICKEN_EXPORT_FILES = $(MSVC_CHICKEN_IMPORT_LIBRARIES:.lib=.exp)
106LIBCHICKEN_SO_LINKER_OPTIONS = -implib:$(LIBCHICKEN_IMPORT_LIBRARY)
107LIBUCHICKEN_SO_LINKER_OPTIONS = -implib:$(LIBUCHICKEN_IMPORT_LIBRARY)
108LIBCHICKENGUI_SO_LINKER_OPTIONS = -implib:$(LIBCHICKENGUI_IMPORT_LIBRARY)
109
110# librarian-dependent output options
111
112LIBRARIAN_OPTIONS = -nologo
113LIBRARIAN_OUTPUT_OPTION = -out:
114LIBRARIAN_OUTPUT = $(LIBRARIAN_OUTPUT_OPTION)$@
115
116# assembler-dependent (here we are configured for compiling C w/ inline assembly)
117
118ASSEMBLER_OPTIONS = $(C_COMPILER_OPTIONS)
119ASSEMBLER_OUTPUT_OPTION = -Fo
120ASSEMBLER_OUTPUT = $(ASSEMBLER_OUTPUT_OPTION)$@
121ASSEMBLER_COMPILE_OPTION = -c
122
123# stuff for static-only builds
124ifdef STATICBUILD
125PRIMARY_LIBCHICKEN = libchicken$(A)
126else
127PRIMARY_LIBCHICKEN = libchicken$(SO)
128LIBCHICKEN_SO_FILE = libchicken$(SO)
129LIBUCHICKEN_SO_FILE = libuchicken$(SO)
130LIBCHICKENGUI_SO_FILE = libchickengui$(SO)
131endif
132
133# import libraries, needed in windows
134
135LIBCHICKEN_SO_LIBRARIES = $(LIBRARIES)
136LIBUCHICKEN_SO_LIBRARIES = $(LIBRARIES)
137LIBCHICKENGUI_SO_LIBRARIES = $(LIBRARIES) kernel32.lib user32.lib gdi32.lib
138
139# manifest files, yet more windows crap (VC2005+)
140
141INSTALL_MANIFEST_OPTIONS = -m755
142
143CHICKEN_MANIFEST = $(CHICKEN_PROGRAM)$(EXE)$(MANIFEST)
144CSI_MANIFEST = $(CSI_PROGRAM)$(EXE)$(MANIFEST)
145CHICKEN_PROFILE_MANIFEST = $(CHICKEN_PROFILE_PROGRAM)$(EXE)$(MANIFEST)
146CSC_MANIFEST = $(CSC_PROGRAM)$(EXE)$(MANIFEST)
147CHICKEN_BUG_MANIFEST = $(CHICKEN_BUG_PROGRAM)$(EXE)$(MANIFEST)
148ifndef BUILD_SETUP_TOOLS
149CHICKEN_SETUP_MANIFEST = $(CHICKEN_SETUP_PROGRAM)$(EXE)$(MANIFEST)
150CLEAN_MANIFESTS = $(CHICKEN_MANIFEST) $(CSI_MANIFEST) $(CHICKEN_PROFILE_MANIFEST) \
151                  $(CSC_MANIFEST) $(CHICKEN_BUG_MANIFEST) $(CHICKEN_SETUP_MANIFEST) \
152                  $(LIBCHICKEN_SO_FILE)$(MANIFEST) $(LIBUCHICKEN_SO_FILE)$(MANIFEST) \
153                  $(LIBCHICKENGUI_SO_FILE)$(MANIFEST)
154else
155CHICKEN_INSTALL_MANIFEST = $(CHICKEN_INSTALL_PROGRAM)$(EXE)$(MANIFEST)
156CHICKEN_UNINSTALL_MANIFEST = $(CHICKEN_UNINSTALL_PROGRAM)$(EXE)$(MANIFEST)
157CHICKEN_STATUS_MANIFEST = $(CHICKEN_STATUS_PROGRAM)$(EXE)$(MANIFEST)
158CLEAN_MANIFESTS = $(CHICKEN_MANIFEST) $(CSI_MANIFEST) $(CHICKEN_PROFILE_MANIFEST) \
159                  $(CSC_MANIFEST) $(CHICKEN_BUG_MANIFEST) $(CHICKEN_INSTALL_MANIFEST) \
160                  $(CHICKEN_UNINSTALL_MANIFEST) $(CHICKEN_STATUS_MANIFEST) \
161                  $(LIBCHICKEN_SO_FILE)$(MANIFEST) $(LIBUCHICKEN_SO_FILE)$(MANIFEST) \
162                  $(LIBCHICKENGUI_SO_FILE)$(MANIFEST)
163endif
164
165# special files
166
167CHICKEN_CONFIG_H = chicken-config.h
168APPLY_HACK_SRC = 
169APPLY_HACK_OBJECT = 
170POSIXFILE = posixwin
171
172# default settings (the default chicken-defaults.h seems to be fine)
173
174include defaults.make
175
176# main target
177
178all: libchicken$(A) libuchicken$(A) chicken$(EXE) csi$(EXE) chicken-profile$(EXE) \
179        csc$(EXE) libchicken$(SO) \
180        libuchicken$(SO) libchickengui$(SO) libchickengui$(A) chicken-setup$(EXE) \
181        chicken.info
182
183chicken-config.h: chicken-defaults.h
184        echo "#define HAVE_DIRENT_H 0" >>$@
185        echo "#define HAVE_INTTYPES_H 0" >>$@
186        echo "#define HAVE_LIMITS_H 1" >>$@
187        echo "#define HAVE_LONG_LONG 1" >>$@
188        echo "#define HAVE_MEMMOVE 1" >>$@
189        echo "#define HAVE_MEMORY_H 1" >>$@
190        echo "#define HAVE_STDINT_H 0" >>$@
191        echo "#define HAVE_STDLIB_H 1" >>$@
192        echo "#define HAVE_STRERROR 1" >>$@
193        echo "#define HAVE_STRINGS_H 0" >>$@
194        echo "#define HAVE_STRING_H 1" >>$@
195        echo "#define HAVE_STRTOLL 0" >>$@
196        echo "#define HAVE_SYS_STAT_H 1" >>$@
197        echo "#define HAVE_SYS_TYPES_H 1" >>$@
198        echo "#define HAVE_UNISTD_H 0" >>$@
199        echo "#define HAVE_UNSIGNED_LONG_LONG 0" >>$@
200        echo "#define HAVE_WINDOWS_H 1" >>$@
201        echo "#define HAVE__STRTOI64 1" >>$@
202        echo "#define STDC_HEADERS 1" >>$@
203        echo "#define HAVE_ALLOCA_H 0" >>$@
204        echo "#define HAVE_DIRECT_H 1" >>$@
205        echo "#define HAVE_ERRNO_H 1" >>$@
206        echo "#define HAVE_GCVT 1" >>$@
207        echo "#define HAVE_LOADLIBRARY 1" >>$@
208        echo "#define HAVE_GETPROCADDRESS 1" >>$@
209        echo "#define HAVE_WINSOCK2_H 1" >>$@
210        echo "#define HAVE_WS2TCPIP_H 1" >>$@
211        echo "#define C_STACK_GROWS_DOWNWARD 1" >>$@
212ifdef GCHOOKS
213        echo "#define C_GC_HOOKS" >>$@
214endif
215ifdef SYMBOLGC
216        echo "#define C_COLLECT_ALL_SYMBOLS" >>$@
217endif
218ifdef NOAPPLYHOOK
219        echo "#define C_NO_APPLY_HOOK" >>$@
220endif
221        echo "#define C_HACKED_APPLY" >>$@
222        cat chicken-defaults.h >>$@
223
224include rules.make
Note: See TracBrowser for help on using the repository browser.