source: release/1.6/source/lisp-kernel/win64/Makefile @ 14393

Last change on this file since 14393 was 14393, checked in by rme, 10 years ago

Merge makefile changes involving SVN_REVISION from trunk.

File size: 3.4 KB
Line 
1#
2#   Copyright (C) 2007 Clozure Associates
3#   This file is part of Clozure CL. 
4#
5#   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
6#   License , known as the LLGPL and distributed with Clozure CL as the
7#   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
8#   which is distributed with Clozure CL as the file "LGPL".  Where these
9#   conflict, the preamble takes precedence. 
10#
11#   Clozure CL is referenced in the preamble as the "LIBRARY."
12#
13#   The LLGPL is also available online at
14#   http://opensource.franz.com/preamble.html
15
16SVN_REVISION=$(shell svnversion || echo "unknown")
17
18VPATH = ../
19RM = /bin/rm
20# gcc64, as64: until there's a real win64 gcc, assume that gcc and gas
21# are installed under these names
22CC = x86_64-w64-mingw32-gcc
23AS = x86_64-w64-mingw32-as
24M4 = m4
25LD = x86_64-w64-mingw32-ld
26ASFLAGS = -g --64
27M4FLAGS = -DWIN_64 -DWINDOWS -DX86 -DX8664 -DHAVE_TLS -DEMUTLS -DTCR_IN_GPR
28CDEFINES = -DWIN_64 -DWINDOWS -D_REENTRANT -DX86 -DX8664 -D_GNU_SOURCE -DHAVE_TLS -DEMUTLS -DTCR_IN_GPR -DSVN_REVISION=$(SVN_REVISION)
29CDEBUG = -g
30COPT = -O2
31# Once in a while, -Wformat says something useful.  The odds are against that,
32# however.
33WFORMAT = -Wno-format
34PLATFORM_H = platform-win64.h
35
36# If the linker supports a "--hash-style=" option, use traditional
37# SysV hash tables.  (If it doesn't support that option, assume
38# that traditional hash tables will be used by default.)
39ld_has_hash_style = $(shell $(LD) --help | grep "hash-style=")
40ifeq ($(ld_has_hash_style),)
41HASH_STYLE=
42else
43HASH_STYLE="-Wl,--hash-style=sysv"
44endif
45
46# There may be some confusion about whether or not C symbols have
47# leading underscores or not.  The assembler sources seem to
48# expect them to and mingw import libs seem to use them, but
49# it's not clear whether or not native win64 libraries use this
50# convention (and I'm not sure whether the Cygwin-hosted win64
51# toolchain behaves the same was as when hosted on Linux ...
52# The compiler default seems to be to use them; if we want to
53# suppress their use, uncomment the following:
54
55SUPPRESS_UNDERSCORES=#-fno-leading-underscore
56
57.s.o:
58        $(M4) $(M4FLAGS) -I../ $< | $(AS)  $(ASFLAGS) -o $@
59.c.o:
60        $(CC) -include ../$(PLATFORM_H) -c $< $(CDEFINES) $(CDEBUG) $(COPT) $(WFORMAT) ${SUPPRESS_UNDERSCORES} -m64 -o $@
61
62SPOBJ = pad.o x86-spjump64.o x86-spentry64.o x86-subprims64.o
63ASMOBJ = x86-asmutils64.o imports.o
64
65COBJ  = pmcl-kernel.o gc-common.o x86-gc.o bits.o  x86-exceptions.o \
66        image.o thread_manager.o lisp-debug.o memory.o windows-calls.o
67
68DEBUGOBJ = lispdcmd.o plprint.o plsym.o xlbt.o x86_print.o
69KERNELOBJ= $(COBJ) x86-asmutils64.o  imports.o
70
71SPINC = lisp.s m4macros.m4 x86-constants.s x86-macros.s errors.s x86-uuo.s \
72        x86-constants64.s
73
74CHEADERS = area.h bits.h x86-constants.h lisp-errors.h gc.h lisp.h \
75        lisp-exceptions.h lisp_globals.h macros.h memprotect.h image.h \
76        threads.h x86-constants64.h x86-exceptions.h lisptypes.h \
77        $(PLATFORM_H) constants.h os-windows.h
78
79
80KSPOBJ = $(SPOBJ)
81all:    ../../wx86cl64.exe
82
83
84OSLIBS = -lpsapi -lws2_32
85
86
87../../wx86cl64.exe:     $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) Makefile pei-x86-64.x
88        $(CC) -Wl,--image-base=0x10000 -Wl,-script=pei-x86-64.x -m64 $(CDEBUG)   $(HASH_STYLE) -o $@ $(USE_LINK_MAP) $(KSPOBJ) $(KERNELOBJ) $(DEBUGOBJ) $(OSLIBS)
89
90
91$(SPOBJ): $(SPINC)
92$(ASMOBJ): $(SPINC)
93$(COBJ): $(CHEADERS)
94$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
95
96
97cclean:
98        $(RM) -f $(KERNELOBJ) $(DEBUGOBJ) ../../wx86cl64.exe
99
100clean:  cclean
101        $(RM) -f $(SPOBJ)
102
103strip:  ../../wx86cl64.exe
104        strip -g ../../wx86cl64.exe
Note: See TracBrowser for help on using the repository browser.