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