-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile.Cygwin64
151 lines (117 loc) · 4.97 KB
/
Makefile.Cygwin64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# makefile for EusLisp on cygwin
# RCSid="@(#)$Id: Makefile.Cygwin 166 2009-08-07 10:08:37Z eus $"
# Copyright (1988) Toshihiro MATSUI, Electrotechnical Laboratory
# 1989/Oct
# 1990/Sep Second Tape Distribution
# KOBJECTS --- eus kernel objects written in C
# NOKOBJECTS-- eus kernel, but cannot be optimized with -O option
# CLIBOBJECTS- functions written in C, not members of kernel
# LOBJECTS --- functions coded in EUSLISP; must be compiled with euscomp
# GEOOBJECTS-- geometric modeling functions and classes
# XOBJECTS---- Xwindow interface
# XTKOBJECTS---- Xwindow interface
# IMGOBJECTS--- image processing
# MTOBJECTS--- multithread functions
#
#########################################################################
# Customizable section begins
#########################################################################
ARCH=Cygwin
include Makefile.generic1
THREAD= -DTHREADED -DPTHREAD
MFLAGS=
XVERSION=X_V11R6_1
#
# Select CFLAGS and XVERSION according to the version of SunOS and Xlib.
#
# for Cygwin
CPU_OPTIMIZE=-mcpu=i486
# Pentium's arch returns 'i586', which is ignored by conditionals in c/*.[ch].
MACHINE=i486
DEBUG= -g
# If you use libc.so.5, remove -DLIB6 option.
# In order to include thread library, libc.so.6 is preferrable.
CFLAGS=-D$(MACHINE) -DCygwin -D_REENTRANT -DVERSION=\"$(VERSION)\" \
-DGCC -DKERNEL -falign-functions=8 \
$(DEBUG) $(CPU_OPTIMIZE) $(THREAD) -D$(XVERSION) \
-I/usr/include -I/usr/X11R6/include -I$(EUSDIR)/lisp/c
# Use gcc for C-compiling on SunOS4. Sun's cc is ok on Solaris.
# /usr/ucb/cc cannot compile because of its incapability of recognizing
# prototype declarations.
CC=gcc
#
# L I B R A R I E S
# Three kinds of libraries are needed to build eus.
# 1. RAWLIB: unix libraries needed to make eus0-eus2
# 2. XLIB: X window libraries
# When you use a window toolkit, you may need to override the 'read'
# function in libc.a with a specific window library such as libXview.a.
# 3. EUSLIB: euslisp functions that cannot be linked in eus because of
# 'GLOBAL OFFSET TABLE OVERFLOW', that are xwindow interface functions.
# You may add any optional user-supplied library in EUSLIB.
# On Solaris, XLIB and EUSLIB are combined together into lib/libeusx.so.
# Cygwin
RAWLIB=-lm -lpthread
XLIB=-L/usr/X11R6/lib -lX11
# specify directories where euslisp's libraries are located.
EUSLIB= -L$(ADLIBDIR)
GLLIB=-L/usr/X11R6/lib -lGLU -lGL -lXext
# POSIX Thread
THREADDEP=mthread_posix.c
# If you don't like optimization, comment out the next line.
OFLAGS=-O2
# link-editor's default flags ?-rdynamic
#SOFLAGS= -shared --allow-shlib-undefined --warn-unresolved-symbols --unresolved-symbols=ignore-all --warn-once --enable-extra-pe-debug --enable-auto-import
SOFLAGS= -shared --export-all-symbols --unresolved-symbols=ignore-all --enable-runtime-pseudo-reloc
LDFLAGS= -Wl,--out-implib=$(BINDIR)/$(@F).a -Wl,--export-all-symbols -Wl,--enable-auto-import
MTCOBJECTS= $(OBJDIR)/mthread.o $(OBJDIR)/mthread_posix.o
MAPOPTION= $(OBJDIR)/par.o
#################################################################
# end of the customizable section
################################################################
#include Makefile.rgc
include Makefile.generic2
libeusgl.dll: $(ADLIBDIR)/libeusgl.dll
$(BINDIR)/eusg: $(BINDIR)/eus2 $(MTOBJECTS) $(GEOOBJECTS) $(GEOCOBJECTS) \
$(IMGCOBJECTS) $(IMGOBJECTS)
($(CC) -o $(BINDIR)/eusg $(LDFLAGS) \
$(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) $(LOBJECTS) \
$(LCOBJECTS) $(MTCOBJECTS) $(RGCOBJECTS) $(MTOBJECTS) \
$(GEOOBJECTS) $(GEOCOBJECTS) \
$(IMGCOBJECTS) $(IMGOBJECTS) \
$(COMPOBJECTS) $(EUSLIB) $(RAWLIB) ; \
cd $(BINDIR); rm -f euscomp; ln -sf eusg euscomp)
$(BINDIR)/eusx: $(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) $(LOBJECTS) \
$(COMPOBJECTS) \
$(MTCOBJECTS) $(RGCOBJECTS) $(MTOBJECTS) \
$(XOBJECTS) $(XTKOBJECTS) $(XCOBJECTS)
($(CC) -o $(BINDIR)/eusx $(LDFLAGS) \
$(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) \
$(LOBJECTS) $(LCOBJECTS) $(COMPOBJECTS) \
$(MTCOBJECTS) $(RGCOBJECTS) $(MTOBJECTS) \
$(GEOOBJECTS) $(GEOCOBJECTS) \
$(IMGCOBJECTS) $(IMGOBJECTS) \
$(XOBJECTS) $(XTKOBJECTS) $(XCOBJECTS) \
$(XLIB) $(RAWLIB);)
$(BINDIR)/eusgl: $(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) $(LOBJECTS) \
$(LCOBJECTS) $(COMPOBJECTS) $(MAPOPTION) \
$(LIBEUSGEO) $(LIBEUSX) $(LIBEUSGL)
($(CC) $(LDFLAGS) -o $(BINDIR)/eusgl.exe \
$(NOKOBJECTS) $(KOBJECTS) $(KSOBJECTS) \
$(LOBJECTS) $(LCOBJECTS) $(COMPOBJECTS) \
$(MTCOBJECTS) $(RGCOBJECTS) $(MTOBJECTS) \
$(MAPOPTION) $(GEOOBJECTS) $(GEOCOBJECTS) \
$(IMGCOBJECTS) $(IMGOBJECTS) \
$(XOBJECTS) $(XTKOBJECTS) $(XCOBJECTS) \
$(GLCOBJECTS) $(GLOBJECTS) \
$(XLIB) $(GLLIB) $(RAWLIB)\
>$(ADLIBDIR)/eusmap ;)
$(ADLIBDIR)/$(LIBEUSGEO):
@echo ";; Do not compile $(LIBEUSGEO) for Cygwin"
$(ADLIBDIR)/$(LIBEUSX):
@echo ";; Do not compile $(LIBEUSX) for Cygwin"
$(ADLIBDIR)/$(LIBEUSGL):
@echo ";; Do not compile $(LIBEUSGL) for Cygwin"
$(BINDIR)/eus:
@echo ";; Do not compile eus for Cygwin, Just symlink"
(cd $(BINDIR); rm -f eus.exe; ln -sf eusgl.exe eus.exe)