diff --git a/Makefile b/Makefile index 91454e6..38a722f 100644 --- a/Makefile +++ b/Makefile @@ -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)/ diff --git a/config/Makefile.cygming b/config/Makefile.cygming index 6147717..1436c65 100644 --- a/config/Makefile.cygming +++ b/config/Makefile.cygming @@ -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) diff --git a/config/Makefile.cygwin b/config/Makefile.cygwin index 8280bf2..49d4763 100644 --- a/config/Makefile.cygwin +++ b/config/Makefile.cygwin @@ -1,8 +1,9 @@ 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 diff --git a/config/Makefile.linux-mingw32 b/config/Makefile.linux-mingw32 index ead1ff4..386658d 100644 --- a/config/Makefile.linux-mingw32 +++ b/config/Makefile.linux-mingw32 @@ -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 diff --git a/config/Makefile.linux-mingw64 b/config/Makefile.linux-mingw64 index f32a882..d14f23d 100644 --- a/config/Makefile.linux-mingw64 +++ b/config/Makefile.linux-mingw64 @@ -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 diff --git a/config/Makefile.mingw b/config/Makefile.mingw index 1fbf3f6..e04e00d 100644 --- a/config/Makefile.mingw +++ b/config/Makefile.mingw @@ -1,7 +1,8 @@ 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