For SYSTEM=msys put dll in bin directory

This commit is contained in:
Nigel Stewart 2019-09-27 23:31:32 +10:00
parent 5509e2e13e
commit 3f91cd177a
3 changed files with 12 additions and 10 deletions

View File

@ -89,6 +89,7 @@ all debug: glew.lib glew.bin
LIB.LDFLAGS := $(LDFLAGS.EXTRA) $(LDFLAGS.GL) LIB.LDFLAGS := $(LDFLAGS.EXTRA) $(LDFLAGS.GL)
LIB.LIBS := $(GL_LDFLAGS) LIB.LIBS := $(GL_LDFLAGS)
LIB.SHARED.DIR ?= lib
LIB.SRCS := src/glew.c LIB.SRCS := src/glew.c
LIB.SRCS.NAMES := $(notdir $(LIB.SRCS)) LIB.SRCS.NAMES := $(notdir $(LIB.SRCS))
@ -100,7 +101,7 @@ LIB.SOBJS := $(LIB.SOBJS:.c=.o)
glew.lib: glew.lib.shared glew.lib.static glew.lib: glew.lib.shared glew.lib.static
glew.lib.shared: lib lib/$(LIB.SHARED) glew.pc glew.lib.shared: lib $(LIB.SHARED.DIR) $(LIB.SHARED.DIR)/$(LIB.SHARED) glew.pc
glew.lib.static: lib lib/$(LIB.STATIC) glew.pc glew.lib.static: lib lib/$(LIB.STATIC) glew.pc
.PHONY: glew.lib glew.lib.shared glew.lib.static .PHONY: glew.lib glew.lib.shared glew.lib.static
@ -118,11 +119,11 @@ ifneq ($(STRIP),)
$(STRIP) -x $@ $(STRIP) -x $@
endif endif
lib/$(LIB.SHARED): $(LIB.SOBJS) $(LIB.SHARED.DIR)/$(LIB.SHARED): $(LIB.SOBJS)
$(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS) $(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
ifneq ($(LN),) ifneq ($(LN),)
$(LN) $(LIB.SHARED) lib/$(LIB.SONAME) $(LN) $(LIB.SHARED) $(LIB.SHARED.DIR)/$(LIB.SONAME)
$(LN) $(LIB.SHARED) lib/$(LIB.DEVLNK) $(LN) $(LIB.SHARED) $(LIB.SHARED.DIR)/$(LIB.DEVLNK)
endif endif
ifneq ($(STRIP),) ifneq ($(STRIP),)
$(STRIP) -x $@ $(STRIP) -x $@
@ -178,13 +179,13 @@ endif
bin: bin:
mkdir bin mkdir bin
bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) lib/$(LIB.SHARED) bin/$(GLEWINFO.BIN): $(GLEWINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS) $(CC) $(CFLAGS) -o $@ $(GLEWINFO.BIN.OBJ) $(BIN.LIBS)
ifneq ($(STRIP),) ifneq ($(STRIP),)
$(STRIP) -x $@ $(STRIP) -x $@
endif endif
bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) lib/$(LIB.SHARED) bin/$(VISUALINFO.BIN): $(VISUALINFO.BIN.OBJ) $(LIB.SHARED.DIR)/$(LIB.SHARED)
$(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS) $(CC) $(CFLAGS) -o $@ $(VISUALINFO.BIN.OBJ) $(BIN.LIBS)
ifneq ($(STRIP),) ifneq ($(STRIP),)
$(STRIP) -x $@ $(STRIP) -x $@
@ -209,9 +210,9 @@ install.lib: glew.lib
# runtime # runtime
ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),) ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
$(INSTALL) -d -m 0755 "$(DESTDIR)$(BINDIR)" $(INSTALL) -d -m 0755 "$(DESTDIR)$(BINDIR)"
$(INSTALL) -m 0755 lib/$(LIB.SHARED) "$(DESTDIR)$(BINDIR)/" $(INSTALL) -m 0755 $(LIB.SHARED.DIR)/$(LIB.SHARED) "$(DESTDIR)$(BINDIR)/"
else else
$(INSTALL) -m 0644 lib/$(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/" $(INSTALL) -m 0644 $(LIB.SHARED.DIR)/$(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/"
endif endif
ifneq ($(LN),) ifneq ($(LN),)
$(LN) $(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/$(LIB.SONAME)" $(LN) $(LIB.SHARED) "$(DESTDIR)$(LIBDIR)/$(LIB.SONAME)"

View File

@ -7,7 +7,7 @@ CFLAGS.EXTRA += -D_WIN32
LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32 LDFLAGS.GL = -lopengl32 -lgdi32 -luser32 -lkernel32
LDFLAGS.EXTRA = LDFLAGS.EXTRA =
CFLAGS.EXTRA += -fno-builtin -fno-stack-protector CFLAGS.EXTRA += -fno-builtin -fno-stack-protector
LDFLAGS.EXTRA += -nostdlib #LDFLAGS.EXTRA += -nostdlib
LIBDIR = $(GLEW_DEST)/bin LIBDIR = $(GLEW_DEST)/bin
WARN = -Wall -W WARN = -Wall -W
POPT = -O2 POPT = -O2
@ -15,5 +15,6 @@ BIN.SUFFIX = .exe
LIB.SONAME = lib$(NAME).dll LIB.SONAME = lib$(NAME).dll
LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib LIB.DEVLNK = lib$(NAME).dll.a # for mingw this is the dll import lib
LIB.SHARED = $(NAME).dll LIB.SHARED = $(NAME).dll
LIB.SHARED.DIR = bin
LIB.STATIC = lib$(NAME).a # the static lib will be broken LIB.STATIC = lib$(NAME).a # the static lib will be broken
LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK) LDFLAGS.SO = -shared -Wl,-soname,$(LIB.SONAME) -Wl,--out-implib,lib/$(LIB.DEVLNK)

View File

@ -1,5 +1,5 @@
include config/Makefile.msys include config/Makefile.msys
POPT := -mtune=generic -O2 POPT := -mtune=generic -O2
CFLAGS.EXTRA += -m64 CFLAGS.EXTRA += -m64 -Wno-cast-function-type
LDFLAGS.EXTRA += -m64 LDFLAGS.EXTRA += -m64