Commit 0af3be62 authored by Nigel Stewart's avatar Nigel Stewart
Browse files

Optional symlink step for GLEW build. For Cygwin, Mingw32, etc.

parent af5a34cb
......@@ -56,6 +56,9 @@ DIST_SRC_TGZ = glew-$(GLEW_VERSION).tgz
# To disable stripping of binaries either:
# - use STRIP= on gmake command-line
# - edit this makefile to set STRIP to the empty string
#
# To disable symlinks:
# - use LN= on gmake command-line
AR ?= ar
INSTALL ?= install
......@@ -104,8 +107,7 @@ endif
lib/$(LIB.SHARED): $(LIB.SOBJS)
$(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
else
ifneq ($(LN),)
$(LN) $(LIB.SHARED) lib/$(LIB.SONAME)
$(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK)
endif
......@@ -141,8 +143,7 @@ lib/$(LIB.STATIC.MX): $(LIB.OBJS.MX)
lib/$(LIB.SHARED.MX): $(LIB.SOBJS.MX)
$(LD) $(LDFLAGS.SO.MX) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
else
ifneq ($(LN),)
$(LN) $(LIB.SHARED.MX) lib/$(LIB.SONAME.MX)
$(LN) $(LIB.SHARED.MX) lib/$(LIB.DEVLNK.MX)
endif
......@@ -224,12 +225,16 @@ ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(INSTALL) -m 0755 lib/$(LIB.SHARED) $(BINDIR)/
else
$(INSTALL) -m 0644 lib/$(LIB.SHARED) $(LIBDIR)/
endif
ifneq ($(LN),)
$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.SONAME)
endif
# development files
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(INSTALL) -m 0644 lib/$(LIB.DEVLNK) $(LIBDIR)/
else
endif
ifneq ($(LN),)
$(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.DEVLNK)
endif
$(INSTALL) -m 0644 lib/$(LIB.STATIC) $(LIBDIR)/
......@@ -242,12 +247,15 @@ ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(INSTALL) -m 0755 lib/$(LIB.SHARED.MX) $(BINDIR)/
else
$(INSTALL) -m 0644 lib/$(LIB.SHARED.MX) $(LIBDIR)/
endif
ifneq ($(LN),)
$(LN) $(LIB.SHARED.MX) $(LIBDIR)/$(LIB.SONAME.MX)
endif
# development files
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(INSTALL) -m 0644 lib/$(LIB.DEVLNK.MX) $(LIBDIR)/
else
endif
ifneq ($(LN),)
$(LN) $(LIB.SHARED.MX) $(LIBDIR)/$(LIB.DEVLNK.MX)
endif
$(INSTALL) -m 0644 lib/$(LIB.STATIC.MX) $(LIBDIR)/
......
......@@ -3,9 +3,10 @@ GLEW_DEST = /usr
BINDIR = /usr/bin
LIBDIR = /usr/lib/mingw
INCDIR = /usr/include/mingw/GL
CC = gcc -mno-cygwin
# use gcc for linking, with ld it does not work
LD = gcc -mno-cygwin
CC := gcc -mno-cygwin
LD := gcc -mno-cygwin
LN :=
CFLAGS.SO = -DGLEW_BUILD
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
LDFLAGS.EXTRA = -L$(LIBDIR)
......
NAME = GLEW
GLEW_DEST ?= /usr
CC = cc
# use gcc for linking, with ld it does not work
LD = cc
CC := cc
LD := cc
LN :=
LDFLAGS.EXTRA =
LIBDIR = $(GLEW_DEST)/lib
LDFLAGS.GL = -lXmu -lXi -lGLU -lGL -lXext -lX11
......
......@@ -4,9 +4,11 @@
# $ make SYSTEM=linux-mingw32
#
NAME = glew32
CC = i586-mingw32msvc-gcc
LD = i586-mingw32msvc-ld
NAME := glew32
CC := i586-mingw32msvc-gcc
LD := i586-mingw32msvc-ld
LN :=
STRIP :=
CFLAGS.SO = -DGLEW_BUILD
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
WARN = -Wall -W
......
......@@ -4,9 +4,11 @@
# $ make SYSTEM=linux-mingw64
#
NAME = glew32
CC = amd64-mingw32msvc-gcc
LD = amd64-mingw32msvc-ld
NAME := glew32
CC := amd64-mingw32msvc-gcc
LD := amd64-mingw32msvc-ld
LN :=
STRIP :=
CFLAGS.SO = -DGLEW_BUILD
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
WARN = -Wall -W
......
NAME = glew32
CC = gcc
# use gcc for linking, with ld it does not work
LD = gcc
CC := gcc
LD := gcc
LN :=
CFLAGS.SO = -DGLEW_BUILD
LDFLAGS.GL = -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
LDFLAGS.EXTRA = -L/mingw/lib
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment