Changing over makefiles so LDFLAGS.STATIC is used. Also added makefile.darwin-universal for creating a universal static library that can be used properly.

This commit is contained in:
BastiaanOlij 2015-03-15 18:55:29 +11:00
parent 4fcd4688a5
commit 0c9ab41431
23 changed files with 54 additions and 15 deletions

View File

@ -104,7 +104,7 @@ lib:
mkdir lib
lib/$(LIB.STATIC): $(LIB.OBJS)
$(AR) cr $@ $^
$(AR) $(LDFLAGS.STATIC) $@ $^
ifneq ($(STRIP),)
$(STRIP) -x $@
endif
@ -148,7 +148,7 @@ glew.pc: glew.pc.in
glew.lib.mx: lib lib/$(LIB.SHARED.MX) lib/$(LIB.STATIC.MX) glewmx.pc
lib/$(LIB.STATIC.MX): $(LIB.OBJS.MX)
$(AR) cr $@ $^
$(AR) $(LDFLAGS.STATIC) $@ $^
lib/$(LIB.SHARED.MX): $(LIB.SOBJS.MX)
$(LD) $(LDFLAGS.SO.MX) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)

View File

@ -7,6 +7,7 @@ INCDIR = /usr/include/mingw/GL
CC := gcc -mno-cygwin
LD := gcc -mno-cygwin
LN :=
LDFLAGS.STATIC = cr
LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32
LDFLAGS.EXTRA = -L$(LIBDIR)
WARN = -Wall -W

View File

@ -7,7 +7,7 @@ LN :=
LDFLAGS.EXTRA =
LIBDIR = $(GLEW_DEST)/lib
LDFLAGS.GL = -lGL -lX11
LDFLAGS.STATIC = -Wl,-Bstatic
LDFLAGS.STATIC = cr -Wl,-Bstatic
LDFLAGS.DYNAMIC = -Wl,-Bdynamic
WARN = -Wall -W
POPT = -O2

View File

@ -10,7 +10,7 @@ LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
else
LDFLAGS.GL = -framework AGL -framework OpenGL
endif
LDFLAGS.STATIC =
LDFLAGS.STATIC = cr
LDFLAGS.DYNAMIC =
WARN = -Wall -W
POPT = -O2

View File

@ -10,7 +10,7 @@ LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
else
LDFLAGS.GL = -framework AGL -framework OpenGL
endif
LDFLAGS.STATIC =
LDFLAGS.STATIC = cr
LDFLAGS.DYNAMIC =
WARN = -Wall -W
POPT = -O2

View File

@ -0,0 +1,31 @@
NAME = $(GLEW_NAME)
CC = cc
LD = cc
AR = LIBTOOL
STRIP =
CFLAGS.EXTRA = -dynamic -fno-common
#CFLAGS.EXTRA += -no-cpp-precomp
CFLAGS.EXTRA += -arch i386 -arch x86_64
LDFLAGS.EXTRA = -arch i386 -arch x86_64
ifneq (undefined, $(origin GLEW_APPLE_GLX))
CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
else
LDFLAGS.GL = -framework AGL -framework OpenGL
endif
LDFLAGS.STATIC = -static -o
LDFLAGS.DYNAMIC =
WARN = -Wall -W
POPT = -O2
CFLAGS.EXTRA += -fPIC
BIN.SUFFIX =
LIB.SONAME = lib$(NAME).$(SO_MAJOR).dylib
LIB.DEVLNK = lib$(NAME).dylib
LIB.SHARED = lib$(NAME).$(SO_VERSION).dylib
LIB.STATIC = lib$(NAME).a
LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)
LIB.SONAME.MX = lib$(NAME)mx.$(SO_MAJOR).dylib
LIB.DEVLNK.MX = lib$(NAME)mx.dylib
LIB.SHARED.MX = lib$(NAME)mx.$(SO_VERSION).dylib
LIB.STATIC.MX = lib$(NAME)mx.a
LDFLAGS.SO.MX = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED.MX) -current_version $(SO_VERSION) -compatibility_version $(SO_MAJOR)

View File

@ -10,7 +10,7 @@ LDFLAGS.GL = -L/usr/X11R6/lib -lGL -lX11
else
LDFLAGS.GL = -framework AGL -framework OpenGL
endif
LDFLAGS.STATIC =
LDFLAGS.STATIC = cr
LDFLAGS.DYNAMIC =
WARN = -Wall -W
POPT = -O2

View File

@ -3,7 +3,7 @@ CC = cc
LD = ld
LDFLAGS.EXTRA = -L/usr/X11R6/lib
LDFLAGS.GL = -lGL -lX11
LDFLAGS.STATIC = -Wl,-Bstatic
LDFLAGS.STATIC = cr -Wl,-Bstatic
LDFLAGS.DYNAMIC = -Wl,-Bdynamic
CFLAGS.EXTRA += -I/usr/X11R6/include -fPIC
NAME = GLEW

View File

@ -3,7 +3,7 @@ CC = cc
LD = cc
LDFLAGS.EXTRA = -L/usr/X11R6/lib
LDFLAGS.GL = -lGL -lX11
LDFLAGS.STATIC = -Wl,-Bstatic
LDFLAGS.STATIC = cr -Wl,-Bstatic
LDFLAGS.DYNAMIC = -Wl,-Bdynamic
NAME = GLEW
WARN = -Wall -W

View File

@ -6,7 +6,7 @@ ifneq (undefined, $(origin GLEW_MX))
endif
LDFLAGS.GL = -lGL
LDFLAGS.STATIC = -Wl,-Bstatic
LDFLAGS.STATIC = cr -Wl,-Bstatic
LDFLAGS.DYNAMIC = -Wl,-Bdynamic
NAME = GLEW

View File

@ -4,6 +4,7 @@ LD = ld
ABI = -64# -n32
CC += $(ABI)
LD += $(ABI)
LDFLAGS.STATIC = cr
LDFLAGS.EXTRA =
LDFLAGS.GL = -lGL -lXext -lX11
NAME = GLEW

View File

@ -3,7 +3,7 @@ CC = cc
LD = cc
LDFLAGS.EXTRA = -L/usr/X11R6/lib
LDFLAGS.GL = -lGL -lX11
LDFLAGS.STATIC = -Wl,-Bstatic
LDFLAGS.STATIC = cr -Wl,-Bstatic
LDFLAGS.DYNAMIC = -Wl,-Bdynamic
NAME = GLEW
WARN = -Wall -W

View File

@ -17,7 +17,7 @@ else
LIBDIR = $(GLEW_DEST)/lib
endif
LDFLAGS.GL = -lGL -lX11
LDFLAGS.STATIC = -Wl,-Bstatic
LDFLAGS.STATIC = cr -Wl,-Bstatic
LDFLAGS.DYNAMIC = -Wl,-Bdynamic
NAME = GLEW
WARN = -Wall -W

View File

@ -9,6 +9,7 @@ CC := i686-w64-mingw32-gcc
LD := i686-w64-mingw32-ld
LN :=
STRIP :=
LDFLAGS.STATIC = cr
LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32
WARN = -Wall -W
POPT = -O2

View File

@ -10,6 +10,7 @@ CC := $(HOST)-gcc
LD := $(HOST)-ld
LN :=
STRIP :=
LDFLAGS.STATIC = cr
LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32
WARN = -Wall -W
POPT = -O2

View File

@ -10,6 +10,7 @@ CC := $(HOST)-gcc
LD := $(HOST)-ld
LN :=
STRIP :=
LDFLAGS.STATIC = cr
LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32
WARN = -Wall -W
POPT = -O2

View File

@ -3,6 +3,7 @@ NAME = glew32
CC := gcc
LD := gcc
LN :=
LDFLAGS.STATIC = cr
LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32
LDFLAGS.EXTRA = -L/mingw/lib
WARN = -Wall -W

View File

@ -19,7 +19,7 @@ LDFLAGS.EXTRA += -melf_nacl
LDFLAGS.GL =
LDFLAGS.GLU = -lRegalGLU
LDFLAGS.GLUT = -lRegalGLUT
LDFLAGS.STATIC =
LDFLAGS.STATIC = cr
LDFLAGS.DYNAMIC = -shared
WARN = -Wall -W -Wno-unused-parameter
POPT = -O2

View File

@ -19,7 +19,7 @@ LDFLAGS.EXTRA += -melf64_nacl
LDFLAGS.GL =
LDFLAGS.GLU = -lRegalGLU
LDFLAGS.GLUT = -lRegalGLUT
LDFLAGS.STATIC =
LDFLAGS.STATIC = cr
LDFLAGS.DYNAMIC = -shared
WARN = -Wall -W -Wno-unused-parameter
POPT = -O2

View File

@ -3,7 +3,7 @@ CC = cc
LD = ld
LDFLAGS.EXTRA = -L/usr/X11R7/lib -R /usr/X11R7/lib
LDFLAGS.GL = -lGL -lX11
LDFLAGS.STATIC = -Wl,-Bstatic
LDFLAGS.STATIC = cr -Wl,-Bstatic
LDFLAGS.DYNAMIC = -Wl,-Bdynamic
CFLAGS.EXTRA += -I/usr/X11R7/include -fPIC
NAME = GLEW

View File

@ -3,7 +3,7 @@ CC = cc
LD = ld
LDFLAGS.EXTRA = -L/usr/X11R6/lib
LDFLAGS.GL = -lGLU -lGL -lX11 -lm
LDFLAGS.STATIC = -Wl,-Bstatic
LDFLAGS.STATIC = cr -Wl,-Bstatic
LDFLAGS.DYNAMIC = -Wl,-Bdynamic
CFLAGS.EXTRA += -I/usr/X11R6/include
NAME = GLEW

View File

@ -2,6 +2,7 @@ NAME = $(GLEW_NAME)
CC = cc
LD = ld
CFLAGS.EXTRA = -I/usr/openwin/include -Kpic
LDFLAGS.STATIC = cr
LDFLAGS.SO = -G
LDFLAGS.EXTRA = -L/usr/openwin/lib
LDFLAGS.GL = -lGL -lX11

View File

@ -2,6 +2,7 @@ NAME = $(GLEW_NAME)
CC = gcc
LD = ld
CFLAGS.EXTRA = -I/usr/openwin/include -fPIC
LDFLAGS.STATIC = cr
LDFLAGS.SO = -G
LDFLAGS.EXTRA = -L/usr/openwin/lib
LDFLAGS.GL = -lGL -lX11