source: trunk/source/lisp-kernel/win64/Makefile

Last change on this file was 16685, checked in by rme, 4 years ago

Update copyright/license headers in files.

File size: 3.8 KB
Line 
1#
2# Copyright 2007-2011 Clozure Associates
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16# This makefile is written to be used with the mingw toolchain
17# running in the Cygwin environment.
18#
19# Install the following Cygwin packages:
20# * make
21# * m4
22# * mingw64-x86_64-binutils
23# * mingw64-x86_64-gcc-core
24# * mingw64-x86_64-headers
25# * mingw64-x86_64-pthreads
26# * mingw64-x86_64-runtime
27#
28# Accept the dependencies the installation tool may add.
29
30SVN_REVISION := "$(shell svnversion || echo unknown)"
31
32VPATH = ../
33RM = rm
34# gcc64, as64: until there's a real win64 gcc, assume that gcc and gas
35# are installed under these names
36CC = x86_64-w64-mingw32-gcc
37AS = x86_64-w64-mingw32-as
38M4 = m4
39LD = x86_64-w64-mingw32-ld
40ASFLAGS = -g --64
41M4FLAGS = -DWIN_64 -DWINDOWS -DX86 -DX8664 -DHAVE_TLS -DEMUTLS -DTCR_IN_GPR
42CDEFINES = -DWIN_64 -DWINDOWS -D_REENTRANT -DX86 -DX8664 -D_GNU_SOURCE -DHAVE_TLS -DEMUTLS -DTCR_IN_GPR -DSVN_REVISION=$(SVN_REVISION)
43CDEBUG = -g
44COPT = -O2
45# Once in a while, -Wformat says something useful.  The odds are against that,
46# however.
47WFORMAT = -Wno-format
48PLATFORM_H = platform-win64.h
49
50# If the linker supports a "--hash-style=" option, use traditional
51# SysV hash tables.  (If it doesn't support that option, assume
52# that traditional hash tables will be used by default.)
53ld_has_hash_style = $(shell $(LD) --help | grep "hash-style=")
54ifeq ($(ld_has_hash_style),)
55HASH_STYLE=
56else
57HASH_STYLE="-Wl,--hash-style=sysv"
58endif
59
60# There may be some confusion about whether or not C symbols have
61# leading underscores or not.  The assembler sources seem to
62# expect them to and mingw import libs seem to use them, but
63# it's not clear whether or not native win64 libraries use this
64# convention (and I'm not sure whether the Cygwin-hosted win64
65# toolchain behaves the same was as when hosted on Linux ...
66# The compiler default seems to be to use them; if we want to
67# suppress their use, uncomment the following:
68
69SUPPRESS_UNDERSCORES=#-fno-leading-underscore
70
71.s.o:
72        $(M4) $(M4FLAGS) -I../ $< | $(AS)  $(ASFLAGS) -o $@
73.c.o:
74        $(CC) -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) $(WFORMAT) ${SUPPRESS_UNDERSCORES} -m64 -o $@
75
76SPOBJ = pad.o x86-spjump64.o x86-spentry64.o x86-subprims64.o
77ASMOBJ = x86-asmutils64.o imports.o
78
79COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
80        x86-utils.o \
81        image.o thread_manager.o lisp-debug.o memory.o windows-calls.o
82
83DEBUGOBJ = lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o
84KERNELOBJ= $(COBJ) x86-asmutils64.o  imports.o
85
86SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \
87        x86-constants64.s lisp_globals.s
88
89CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
90        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
91        threads.h x86-constants64.h x86-exceptions.h lisptypes.h \
92        x86-utils.h \
93        $(PLATFORM_H) constants.h os-windows.h
94
95
96KSPOBJ = $(SPOBJ)
97all:    ../../wx86cl64.exe
98
99
100OSLIBS = -lpsapi -lws2_32
101
102
103../../wx86cl64.exe:     $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile pei-x86-64.x
104        $(CC) -Wl,--image-base=0x10000 -Wl,-script=pei-x86-64.x -m64 $(CDEBUG)   $(HASH_STYLE) -o $@ $(USE_LINK_MAP) $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS)
105
106
107$(SPOBJ): $(SPINC)
108$(ASMOBJ): $(SPINC)
109$(COBJ): $(CHEADERS)
110$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
111
112
113cclean:
114        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../wx86cl64.exe
115
116clean:  cclean
117        $(RM) -f $(SPOBJ)
118
119strip:  ../../wx86cl64.exe
120        strip -g ../../wx86cl64.exe
Note: See TracBrowser for help on using the repository browser.