#The following variables can be set by the user: # #NAME - the name of the plugin (project name|dll name). # #EXT - extension of the plugin executable (dll by default). # #ADDOUTDIR - you can set it to /dir if the target folder for the plugin # is a folder inside the default target folder. # This is used in multiarc for building *.fmt. # #USERCPP - user defined switches for the compiler (added after the default # ones). # #USERLIBS - specify additional libs you need in the form -llib # (added after the default ones). # #USERLIBSFIRST - same as USERLIBS but added before the default libs # (libraries order is important for gcc). # #USERRC - user defined switches for windres # #NEEDENTRY - set if you want to disable the -nostartfiles link flag # #NEEDDEFLIB - set if you want to disable the -nodefaultlibs link flag # #EXCLUDECRT - set if you do not want to link with common/crt lib. # #SRCS - a list of the *.cpp source files. # #DOCS - a list of additional files that need to copied to the target folder. # #ANSI - set for ansi build # DEP_FILTER := $(dir $(lastword $(MAKEFILE_LIST)))dep_filter.awk ifndef ANSI DIRSURF = W RCWIDE = -D UNICODE -D _UNICODE CXXWIDE = -D UNICODE -D _UNICODE CCWIDE = -D UNICODE -D _UNICODE endif BASEDIR = ./final.$(DIRBIT)$(DIRSURF).gcc OBJDIR = $(BASEDIR)/obj REOBJDIR = \.\/final\.$(DIRBIT)$(DIRSURF)\.gcc\/obj\/ DLLDIR = $(BASEDIR)$(ADDOUTDIR) ifndef COMMON COMMON = ../common endif ifndef ANSI COMINC = $(COMMON)/unicode else COMINC = $(COMMON)/ascii endif ifndef EXT EXT = dll endif DLLNAME = $(NAME).$(EXT) DLLFULLNAME = $(DLLDIR)/$(DLLNAME) ifeq ($(DIRBIT),32) DEF = $(NAME)$(DIRSURF).gcc.def else #for x64 vc.def is good enough DEF = $(NAME)$(DIRSURF).vc.def endif RC_NAME = $(NAME).rc RES = $(OBJDIR)/$(NAME).res.o NOSTART = -nostartfiles ifdef NEEDENTRY NOSTART = endif NODEFLIBS = -nodefaultlibs ifdef NEEDDEFLIB NODEFLIBS = endif ifeq ($(DIRBIT),32) COMMONLIB = -L $(COMMON) -lCRT else COMMONLIB = -L $(COMMON) -lCRT64 endif ifdef EXCLUDECRT COMMONLIB = endif C_FLAGS = -m$(DIRBIT) -Wall -Os -funsigned-char -fomit-frame-pointer -fstrict-aliasing -fno-exceptions CXXFLAGS = $(C_FLAGS) -std=gnu++0x -fno-rtti -I $(COMMON) -I $(COMINC) $(CXXWIDE) $(USERCPP) CCFLAGS = $(C_FLAGS) -I $(COMMON) -I $(COMINC) $(CCWIDE) $(USERCPP) LNKFLAGS = -m$(DIRBIT) -mdll -s $(NOSTART) $(NODEFLIBS) -static-libgcc -static $(USERLIBSFIRST) $(COMMONLIB) -luser32 -lkernel32 -ladvapi32 -lshell32 $(USERLIBS) RCFLAGS = -I $(COMINC) $(RCWIDE) $(USERRC) OBJS = $(patsubst %.cpp,$(OBJDIR)/%.o,$(filter %.cpp,$(SRCS))) $(RES) ifndef DISABLEAUTODEPS DEPS = $(patsubst %.cpp,$(OBJDIR)/%.d,$(filter %.cpp,$(SRCS))) endif MAP = $(patsubst %.$(EXT),%.map,$(DLLFULLNAME))