source: project/chicken/trunk/defaults.make @ 6176

Last change on this file since 6176 was 6176, checked in by Kon Lovett, 13 years ago

Rmvd pcre 6 stuff.

File size: 8.8 KB
Line 
1# defaults.make - default settings -*- 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# basic parameters
37
38BINARYVERSION = 2
39NURSERY = (128*1024)
40STACKDIRECTION = 1
41CROSS_CHICKEN = 0
42
43# directories
44
45PREFIX = /usr/local
46DESTDIR = $(PREFIX)
47BINDIR = $(DESTDIR)/bin
48LIBDIR = $(DESTDIR)/lib
49SHAREDIR = $(DESTDIR)/share
50DATADIR = $(SHAREDIR)/chicken
51MANDIR = $(SHAREDIR)/man/man1
52INFODIR = $(SHAREDIR)/info
53INCDIR = $(DESTDIR)/include
54DOCDIR = $(DATADIR)/doc
55
56ifdef EXTRASLOT
57EGGDIR = $(DESTDIR)/lib/chicken/$(BINARYVERSION)x
58else
59EGGDIR = $(DESTDIR)/lib/chicken/$(BINARYVERSION)
60endif
61
62# commands
63
64C_COMPILER ?= gcc
65CXX_COMPILER ?= g++
66LINKER ?= $(C_COMPILER)
67LIBRARIAN ?= ar
68REMOVE_COMMAND ?= rm
69ASSEMBLER ?= $(C_COMPILER)
70MAKEINFO_PROGRAM ?= -makeinfo
71INSTALL_PROGRAM ?= install
72MAKEDIR_COMMAND ?= mkdir
73POSTINSTALL_STATIC_LIBRARY ?= true
74POSTINSTALL_PROGRAM ?= true
75INSTALLINFO_PROGRAM ?= -install-info
76UNINSTALLINFO_PROGRAM ?= -install-info
77HOST_C_COMPILER ?= $(C_COMPILER)
78
79# target variables
80
81TARGET_C_COMPILER ?= $(C_COMPILER)
82TARGET_CXX_COMPILER ?= $(CXX_COMPILER)
83TARGET_C_COMPILER_OPTIONS ?= $(C_COMPILER_OPTIONS)
84TARGET_C_COMPILER_OPTIMIZATION_OPTIONS ?= $(C_COMPILER_OPTIMIZATION_OPTIONS)
85TARGET_PREFIX ?= $(PREFIX)
86TARGET_LIBRARIES ?= $(LIBRARIES)
87
88
89# options
90
91ifndef NOPTABLES
92C_COMPILER_PTABLES_OPTIONS = -DC_ENABLE_PTABLES
93endif
94INCLUDES ?= -I.
95PCRE_INCLUDES ?= $(INCLUDES) -Ipcre
96C_COMPILER_COMPILE_OPTION ?= -c
97C_COMPILER_OUTPUT_OPTION ?= -o
98ifdef DEBUGBUILD
99C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
100endif
101C_COMPILER_BUILD_RUNTIME_OPTIONS ?= -DC_BUILDING_LIBCHICKEN
102C_COMPILER_BUILD_UNSAFE_RUNTIME_OPTIONS ?= $(C_COMPILER_BUILD_RUNTIME_OPTIONS) -DNDEBUG -DC_UNSAFE_RUNTIME
103C_COMPILER_PCRE_OPTIONS ?= -DPCRE_STATIC
104C_COMPILER_SHARED_OPTIONS ?= -fPIC -DPIC
105LINKER_OPTIONS ?= -L.
106LINKER_STATIC_OPTIONS ?= $(LINKERFLAGS)
107LINKER_OUTPUT_OPTION ?= -o
108LINKER_LIBRARY_OPTION ?= -l
109LINKER_LINK_SHARED_LIBRARY_OPTIONS ?= -shared
110LIBRARIAN_OPTIONS ?= cru
111LIBRARIES ?= -lm
112REMOVE_COMMAND_OPTIONS ?= -f
113REMOVE_COMMAND_RECURSIVE_OPTIONS ?= -fr
114MAKEINFO_PROGRAM_OPTIONS ?= --no-split
115INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS ?= -m755
116INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS ?= -m644
117INSTALL_PROGRAM_EXECUTABLE_OPTIONS ?= -m755
118INSTALL_PROGRAM_FILE_OPTIONS ?= -m644
119MAKEDIR_COMMAND_OPTIONS ?= -p
120ASSEMBLER_OPTIONS ?= $(C_COMPILER_OPTIONS)
121ASSEMBLER_OUTPUT_OPTION ?= -o
122ASSEMBLER_COMPILE_OPTION ?= -c
123PRIMARY_LIBCHICKEN ?= libchicken$(SO)
124UNINSTALLINFO_PROGRAM_OPTIONS ?= --delete
125HOST_C_COMPILER_OUTPUT_OPTION ?= $(C_COMPILER_OUTPUT_OPTION)
126LIBCHICKEN_SO_LIBRARIES ?= $(LIBRARIES)
127LIBUCHICKEN_SO_LIBRARIES ?= $(LIBRARIES)
128LIBCHICKENGUI_SO_LIBRARIES ?= $(LIBRARIES)
129
130# other settings
131
132HOSTNAME ?= $(shell hostname)
133BUILD_TIME ?= $(shell date +%Y-%m-%d)
134UNAME_SYS ?= $(shell uname)
135BUILD_TAG ?= compiled $(BUILD_TIME) on $(HOSTNAME) ($(UNAME_SYS))
136
137# file extensions
138
139O ?= .o
140A ?= .a
141# EXE =
142SO ?= .so
143
144# special files
145
146POSIXFILE ?= posixunix
147# CHICKEN_CONFIG_H = chicken-config.h
148PCRE_OBJECT_FILES ?= pcre/*.o
149
150ifneq ($(ARCH),)
151HACKED_APPLY = 1
152APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O)
153endif
154
155# bootstrapping compiler
156
157CHICKEN = $(PREFIX)/bin/chicken
158
159# Scheme compiler flags
160
161CHICKEN_OPTIONS = -quiet -no-trace -optimize-level 2 -include-path .
162CHICKEN_LIBRARY_OPTIONS = $(CHICKEN_OPTIONS) -explicit-use
163CHICKEN_PROGRAM_OPTIONS = $(CHICKEN_OPTIONS) -no-lambda-info
164CHICKEN_UNSAFE_OPTIONS = -unsafe -no-lambda-info
165
166# targets
167
168ifdef STATICBUILD
169CHICKEN_STATIC_EXECUTABLE = chicken$(EXE)
170CSI_STATIC_EXECUTABLE = csi$(EXE)
171CHICKEN_SHARED_EXECUTABLE = chicken-shared$(EXE)
172CSI_SHARED_EXECUTABLE = csi-shared$(EXE)
173TARGETS ?= libchicken$(A) libuchicken$(A) $(CHICKEN_STATIC_EXECUTABLE) \
174        $(CSI_STATIC_EXECUTABLE) chicken-profile$(EXE) csc$(EXE) \
175        chicken.info
176else
177CHICKEN_STATIC_EXECUTABLE = chicken-static$(EXE)
178CSI_STATIC_EXECUTABLE = csi-static$(EXE)
179CHICKEN_SHARED_EXECUTABLE = chicken$(EXE)
180CSI_SHARED_EXECUTABLE = csi$(EXE)
181TARGETS ?= libchicken$(A) libuchicken$(A) $(CHICKEN_SHARED_EXECUTABLE) \
182        $(CSI_SHARED_EXECUTABLE) chicken-profile$(EXE) csc$(EXE) libchicken$(SO) \
183        libuchicken$(SO) chicken-setup$(EXE) chicken.info
184endif
185
186# main rule
187
188.PHONY: all
189
190all: $(TARGETS)
191
192# generic part of chicken-config.h
193
194ifndef CUSTOM_CHICKEN_DEFAULTS
195chicken-defaults.h:
196        echo "/* generated */" >$@
197        echo "#define C_BUILD_TAG \"$(BUILD_TAG)\"" >>$@
198        echo "#ifndef C_INSTALL_CC" >>$@
199        echo "# define C_INSTALL_CC \"$(C_COMPILER)\"" >>$@
200        echo "#endif" >>$@
201        echo "#ifndef C_INSTALL_CXX" >>$@
202        echo "# define C_INSTALL_CXX \"$(CXX_COMPILER)\"" >>$@
203        echo "#endif" >>$@
204        echo "#ifndef C_INSTALL_CFLAGS" >>$@
205        echo "# define C_INSTALL_CFLAGS \"$(C_COMPILER_OPTIONS) $(C_COMPILER_OPTIMIZATION_OPTIONS)\"" >>$@
206        echo "#endif" >>$@
207        echo "#ifndef C_INSTALL_SHARE_HOME" >>$@
208        echo "# define C_INSTALL_SHARE_HOME \"$(DATADIR)\"" >>$@
209        echo "#endif" >>$@
210        echo "#ifndef C_INSTALL_BIN_HOME" >>$@
211        echo "# define C_INSTALL_BIN_HOME \"$(BINDIR)\"" >>$@
212        echo "#endif" >>$@
213        echo "#ifndef C_INSTALL_EGG_HOME" >>$@
214        echo "# define C_INSTALL_EGG_HOME \"$(EGGDIR)\"" >>$@
215        echo "#endif" >>$@
216        echo "#ifndef C_INSTALL_LIB_HOME" >>$@
217        echo "# define C_INSTALL_LIB_HOME \"$(LIBDIR)\"" >>$@
218        echo "#endif" >>$@
219        echo "#ifndef C_INSTALL_STATIC_LIB_HOME" >>$@
220        echo "# define C_INSTALL_STATIC_LIB_HOME \"$(LIBDIR)\"" >>$@
221        echo "#endif" >>$@
222        echo "#ifndef C_INSTALL_INCLUDE_HOME" >>$@
223        echo "# define C_INSTALL_INCLUDE_HOME \"$(INCDIR)\"" >>$@
224        echo "#endif" >>$@
225        echo "#ifndef C_INSTALL_MORE_LIBS" >>$@
226        echo "# define C_INSTALL_MORE_LIBS \"$(LIBRARIES)\"" >>$@
227        echo "#endif" >>$@
228        echo "#ifndef C_INSTALL_MORE_STATIC_LIBS" >>$@
229        echo "# define C_INSTALL_MORE_STATIC_LIBS \"$(LIBRARIES)\"" >>$@
230        echo "#endif" >>$@
231        echo "#ifndef C_DEFAULT_TARGET_STACK_SIZE" >>$@
232        echo "# define C_DEFAULT_TARGET_STACK_SIZE $(NURSERY)" >>$@
233        echo "#endif" >>$@
234        echo "#ifndef C_STACK_GROWS_DOWNWARD" >>$@
235        echo "# define C_STACK_GROWS_DOWNWARD $(STACKDIRECTION)" >>$@
236        echo "#endif" >>$@
237        echo "#ifndef C_TARGET_MORE_LIBS" >>$@
238        echo "# define C_TARGET_MORE_LIBS \"$(TARGET_LIBRARIES)\"" >>$@
239        echo "#endif" >>$@
240        echo "#ifndef C_TARGET_MORE_STATIC_LIBS" >>$@
241        echo "# define C_TARGET_MORE_STATIC_LIBS \"$(TARGET_LIBRARIES)\"" >>$@
242        echo "#endif" >>$@
243        echo "#ifndef C_TARGET_CC" >>$@
244        echo "# define C_TARGET_CC \"$(TARGET_C_COMPILER)\"" >>$@
245        echo "#endif" >>$@
246        echo "#ifndef C_TARGET_CXX" >>$@
247        echo "# define C_TARGET_CXX \"$(TARGET_CXX_COMPILER)\"" >>$@
248        echo "#endif" >>$@
249        echo "#ifndef C_TARGET_CFLAGS" >>$@
250        echo "# define C_TARGET_CFLAGS \"$(TARGET_C_COMPILER_OPTIONS) $(TARGET_C_COMPILER_OPTIMIZATION_OPTIONS)\"" >>$@
251        echo "#endif" >>$@
252        echo "#ifndef C_CROSS_CHICKEN" >>$@
253        echo "# define C_CROSS_CHICKEN $(CROSS_CHICKEN)" >>$@
254        echo "#endif" >>$@
255        echo "#ifndef C_TARGET_LIB_HOME" >>$@
256        echo "# define C_TARGET_LIB_HOME \"$(TARGET_PREFIX)/lib\"" >>$@
257        echo "#endif" >>$@
258        echo "#ifndef C_TARGET_RUN_LIB_HOME" >>$@
259        echo "# define C_TARGET_RUN_LIB_HOME \"$(TARGET_PREFIX)/lib\"" >>$@
260        echo "#endif" >>$@
261        echo "#ifndef C_TARGET_SHARE_HOME" >>$@
262        echo "# define C_TARGET_SHARE_HOME \"$(TARGET_PREFIX)/share\"" >>$@
263        echo "#endif" >>$@
264        echo "#ifndef C_TARGET_INCLUDE_HOME" >>$@
265        echo "# define C_TARGET_INCLUDE_HOME \"$(TARGET_PREFIX)/include\"" >>$@
266        echo "#endif" >>$@
267        echo "#ifndef C_TARGET_STATIC_LIB_HOME" >>$@
268        echo "# define C_TARGET_STATIC_LIB_HOME \"$(TARGET_PREFIX)/lib\"" >>$@
269        echo "#endif" >>$@
270endif
Note: See TracBrowser for help on using the repository browser.