Merge authors: poy (poy) ------------------------------------------------------------ revno: 15 [merge] committer: poy <p...@123gen.com> branch nick: ExamplePlugin timestamp: Fri 2013-04-26 17:13:03 +0200 message: merge modified: projects/make/Makefile
-- lp:~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin Your team Dcplusplus-team is subscribed to branch lp:~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin. To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-c/ExamplePlugin/+edit-subscription
=== modified file 'projects/make/Makefile' --- projects/make/Makefile 2013-02-05 19:23:19 +0000 +++ projects/make/Makefile 2013-04-26 15:13:03 +0000 @@ -1,17 +1,20 @@ # This is a rudimentary Makefile that compiles files from the pluginsdk & src directories into a # shared library. Adapt to your needs. -TARGET = MyPlugin # Rename to your plugin's name. +# Rename to your plugin's name. +TARGET = MyPlugin -CPPFLAGS += -march=i686 # Remove if your target architecture is not x86. +CC = gcc +CXX = g++ CPPFLAGS += -Wall -Wextra -g -pipe -O3 -I../../ +CXXFLAGS += -std=gnu++0x LINKFLAGS += -static-libgcc -g -O3 -shared -Wl,--add-stdcall-alias +LINKXXFLAGS += -static-libstdc++ VPATH = ../../ OUTPUT_DIR = build -OUTPUT_OPTION = -o $(OUTPUT_DIR)/$@ OBJS = \ pluginsdk/Config.o \ @@ -20,38 +23,59 @@ src/Plugin.o \ src/stdafx.o -ifeq ($(OS), Windows_NT) +ifeq ($(findstring mingw, $(shell gcc -dumpmachine)),) + LIBEXT = .so +else CPPFLAGS += -D_WIN32_WINNT=0x502 -DWINVER=0x502 -D_WIN32_IE=0x600 \ -DNOMINMAX -DSTRICT -DWIN32_LEAN_AND_MEAN \ -DWIN32 -D_WIN32 -DUNICODE -D_UNICODE + LIBEXT = .dll OBJS += src/resource.o - LIBEXT = .dll + OUTPUT_DIR := $(OUTPUT_DIR)-mingw +endif + +ifeq ($(findstring x86_64, $(shell gcc -dumpmachine)),) + CPPFLAGS += -march=i686 + OUTPUT_DIR := $(OUTPUT_DIR)-x86 +else + OUTPUT_DIR := $(OUTPUT_DIR)-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 + RMDIR = $(RM) -r $1 endif else - LIBEXT = .so MKDIR = mkdir -p $1 - RMDIR += $(RM) -r $1 + RMDIR = $(RM) -r $1 endif -all: \ - ensure-dirs \ - $(TARGET) +TARGET := $(OUTPUT_DIR)/$(TARGET)$(LIBEXT) +OBJS := $(addprefix $(OUTPUT_DIR)/, $(OBJS)) + +all: $(TARGET) $(TARGET): $(OBJS) - cd $(OUTPUT_DIR) && $(CC) $^ $(LINKFLAGS) -o $@$(LIBEXT) - -ensure-dirs: + $(CC) $^ $(LINKFLAGS) $(OUTPUT_OPTION) + +$(OUTPUT_DIR)/%.o: %.c + $(COMPILE.c) $< $(OUTPUT_OPTION) + +$(OUTPUT_DIR)/%.o: %.cpp + $(COMPILE.cpp) $< $(OUTPUT_OPTION) + +$(OUTPUT_DIR)/%.o: %.rc + windres $< $(OUTPUT_OPTION) + +$(OBJS): | $(OUTPUT_DIR) + +$(OUTPUT_DIR): $(call MKDIR,$(OUTPUT_DIR)/pluginsdk) $(call MKDIR,$(OUTPUT_DIR)/src) -src/resource.o: - windres ../../src/resource.rc $(OUTPUT_OPTION) - -clear: +clean: $(call RMDIR,$(OUTPUT_DIR))
_______________________________________________ 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