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 | |
---|
28 | SRCDIR = . |
---|
29 | VPATH = $(SRCDIR) |
---|
30 | |
---|
31 | # platform configuration |
---|
32 | |
---|
33 | DLLSINPATH = 1 |
---|
34 | ARCH = x86 |
---|
35 | HACKED_APPLY = 1 |
---|
36 | WINDOWS = 1 |
---|
37 | |
---|
38 | # file extensions |
---|
39 | |
---|
40 | SO = .dll |
---|
41 | EXE = .exe |
---|
42 | |
---|
43 | # options |
---|
44 | |
---|
45 | C_COMPILER_OPTIONS = -fno-strict-aliasing -DHAVE_CHICKEN_CONFIG_H |
---|
46 | ifdef DEBUGBUILD |
---|
47 | C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused |
---|
48 | else |
---|
49 | C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os |
---|
50 | endif |
---|
51 | C_COMPILER_SHARED_OPTIONS = -DPIC |
---|
52 | C_COMPILER_GUI_RUNTIME_OPTIONS = -DC_WINDOWS_GUI |
---|
53 | LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared |
---|
54 | LIBRARIES = -lm -lws2_32 |
---|
55 | LIBCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libchicken.dll.a |
---|
56 | LIBUCHICKEN_SO_LINKER_OPTIONS = -Wl,--out-implib,libuchicken.dll.a |
---|
57 | LIBCHICKENGUI_SO_LINKER_OPTIONS = -Wl,--out-implib,libchickengui.dll.a |
---|
58 | LIBCHICKEN_SO_LIBRARIES = -lm -lws2_32 |
---|
59 | LIBUCHICKEN_SO_LIBRARIES = -lm -lws2_32 |
---|
60 | LIBCHICKENGUI_SO_LIBRARIES = -lm -lkernel32 -luser32 -lgdi32 -lws2_32 |
---|
61 | LIBCHICKENGUI_IMPORT_LIBRARY = libchickengui.dll.a |
---|
62 | LIBCHICKEN_IMPORT_LIBRARY = libchicken.dll.a |
---|
63 | LIBUCHICKEN_IMPORT_LIBRARY = libuchicken.dll.a |
---|
64 | |
---|
65 | # special files |
---|
66 | |
---|
67 | CHICKEN_CONFIG_H = chicken-config.h |
---|
68 | APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O) |
---|
69 | POSIXFILE = posixwin |
---|
70 | |
---|
71 | # select default and internal settings |
---|
72 | |
---|
73 | include $(SRCDIR)/defaults.make |
---|
74 | |
---|
75 | # main target |
---|
76 | |
---|
77 | all: libchicken$(A) libuchicken$(A) chicken$(EXE) csi$(EXE) chicken-profile$(EXE) \ |
---|
78 | csc$(EXE) libchicken$(SO) \ |
---|
79 | libuchicken$(SO) libchickengui$(SO) libchickengui$(A) chicken-setup$(EXE) \ |
---|
80 | chicken.info |
---|
81 | |
---|
82 | chicken-config.h: chicken-defaults.h |
---|
83 | echo "#define HAVE_DIRENT_H 1" >$@ |
---|
84 | echo "#define HAVE_INTTYPES_H 1" >>$@ |
---|
85 | echo "#define HAVE_LIMITS_H 1" >>$@ |
---|
86 | echo "#define HAVE_LONG_LONG 1" >>$@ |
---|
87 | echo "#define HAVE_MEMMOVE 1" >>$@ |
---|
88 | echo "#define HAVE_MEMORY_H 1" >>$@ |
---|
89 | echo "#define HAVE_STDINT_H 1" >>$@ |
---|
90 | echo "#define HAVE_STDLIB_H 1" >>$@ |
---|
91 | echo "#define HAVE_STRERROR 1" >>$@ |
---|
92 | echo "#define HAVE_STRINGS_H 1" >>$@ |
---|
93 | echo "#define HAVE_STRING_H 1" >>$@ |
---|
94 | echo "#define HAVE_STRTOLL 1" >>$@ |
---|
95 | echo "#define HAVE_SYS_STAT_H 1" >>$@ |
---|
96 | echo "#define HAVE_SYS_TYPES_H 1" >>$@ |
---|
97 | echo "#define HAVE_UNISTD_H 1" >>$@ |
---|
98 | echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@ |
---|
99 | echo "#define HAVE_WINDOWS_H 1" >>$@ |
---|
100 | echo "#define HAVE__STRTOI64 1" >>$@ |
---|
101 | echo "#define STDC_HEADERS 1" >>$@ |
---|
102 | echo "#define HAVE_ALLOCA_H 1" >>$@ |
---|
103 | echo "#define HAVE_DIRECT_H 1" >>$@ |
---|
104 | echo "#define HAVE_ERRNO_H 1" >>$@ |
---|
105 | echo "#define HAVE_GCVT 1" >>$@ |
---|
106 | echo "#define HAVE_LOADLIBRARY 1" >>$@ |
---|
107 | echo "#define HAVE_GETPROCADDRESS 1" >>$@ |
---|
108 | echo "#define HAVE_WINSOCK2_H 1" >>$@ |
---|
109 | echo "#define HAVE_WS2TCPIP_H 1" >>$@ |
---|
110 | echo "#define C_STACK_GROWS_DOWNWARD 1" >>$@ |
---|
111 | ifdef GCHOOKS |
---|
112 | echo "#define C_GC_HOOKS" >>$@ |
---|
113 | endif |
---|
114 | ifdef SYMBOLGC |
---|
115 | echo "#define C_COLLECT_ALL_SYMBOLS" >>$@ |
---|
116 | endif |
---|
117 | ifdef NOAPPLYHOOK |
---|
118 | echo "#define C_NO_APPLY_HOOK" >>$@ |
---|
119 | endif |
---|
120 | echo "#define C_HACKED_APPLY" >>$@ |
---|
121 | cat chicken-defaults.h >>$@ |
---|
122 | |
---|
123 | include $(SRCDIR)/rules.make |
---|