------------------------------------------------------------ revno: 29 committer: poy <p...@123gen.com> branch nick: dcpp-plugin-sdk-c timestamp: Thu 2013-06-20 19:00:20 +0200 message: makefile fix for cross-compilation modified: projects/make/Makefile
-- lp:dcpp-plugin-sdk-c https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-c/trunk Your team Dcplusplus-team is subscribed to branch lp:dcpp-plugin-sdk-c. To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-c/trunk/+edit-subscription
=== modified file 'projects/make/Makefile' --- projects/make/Makefile 2013-06-18 21:42:08 +0000 +++ projects/make/Makefile 2013-06-20 17:00:20 +0000 @@ -24,10 +24,16 @@ COMPILER_SPEC = $(shell $(CC) -dumpmachine) -ifeq ($(findstring mingw, $(COMPILER_SPEC)),) - BINEXT = - LIBEXT = .so -else +ifneq ($(findstring mingw, $(COMPILER_SPEC)),) + WIN_TARGET = 1 +endif +ifeq ($(OS), Windows_NT) + ifeq ($(findstring Cygwin, $(SHELL)),) + WIN_SHELL = 1 + endif +endif + +ifdef WIN_TARGET BINEXT = .exe CPPFLAGS += -D_WIN32_WINNT=0x502 -DWINVER=0x502 -D_WIN32_IE=0x600 \ -DNOMINMAX -DSTRICT -DWIN32_LEAN_AND_MEAN \ @@ -35,6 +41,9 @@ LIBEXT = .dll OBJS += src/resource.o OUTPUT_DIR := $(OUTPUT_DIR)-mingw +else + BINEXT = + LIBEXT = .so endif ifeq ($(findstring x86_64, $(COMPILER_SPEC)),) @@ -46,31 +55,26 @@ TARGET := $(TARGET)-x64 endif -ifeq ($(OS), Windows_NT) - ifeq ($(findstring Cygwin, $(SHELL)),) - MKDIR = if not exist $(subst /,\,$1) md $(subst /,\,$1) - RMDIR = if exist $(subst /,\,$1) rd /s /q $(subst /,\,$1) - else - MKDIR = mkdir -p $1 - RMDIR = $(RM) -r $1 - endif +ifdef WIN_SHELL + MKDIR = if not exist $(subst /,\,$1) md $(subst /,\,$1) + RMDIR = if exist $(subst /,\,$1) rd /s /q $(subst /,\,$1) else MKDIR = mkdir -p $1 RMDIR = $(RM) -r $1 endif -ifeq ($(findstring mingw, $(COMPILER_SPEC)),) - PDB = -else +ifdef WIN_TARGET PDB := $(OUTPUT_DIR)/$(TARGET).pdb - ifeq ($(findstring Cygwin, $(SHELL)),) + ifdef WIN_SHELL RCFLAGS := -DPLUGIN_FILE_NAME="^\\"$(TARGET)\\"" \ -DPLUGIN_FILE_NAME_EXT="^\\"$(TARGET)$(LIBEXT)\\"" else RCFLAGS := -DPLUGIN_FILE_NAME="\\\"$(TARGET)\\\"" \ -DPLUGIN_FILE_NAME_EXT="\\\"$(TARGET)$(LIBEXT)\\\"" endif +else + PDB = endif TARGET := $(OUTPUT_DIR)/$(TARGET)$(LIBEXT) @@ -84,7 +88,7 @@ $(TARGET): $(OBJS) $(CC) $^ $(LINKFLAGS) $(OUTPUT_OPTION) -ifneq ($(findstring mingw, $(COMPILER_SPEC)),) +ifdef WIN_TARGET $(PDB): $(TARGET) strip --only-keep-debug $< $(OUTPUT_OPTION) && strip $< endif @@ -101,7 +105,7 @@ $(OUTPUT_DIR)/%.o: %.cpp $(COMPILE.cpp) $< $(OUTPUT_OPTION) -ifneq ($(findstring mingw, $(COMPILER_SPEC)),) +ifdef WIN_TARGET $(OUTPUT_DIR)/%.o: %.rc windres $< $(RCFLAGS) $(OUTPUT_OPTION) endif
_______________________________________________ Mailing list: https://launchpad.net/~linuxdcpp-team Post to : linuxdcpp-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~linuxdcpp-team More help : https://help.launchpad.net/ListHelp