
#    Copyright (C) 2012 NewestTools.com(AlexLe)
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>. 


TARGETNAME=GuestShellDll64

CC=x86_64-w64-mingw32-c++.exe
STRIP=x86_64-w64-mingw32-strip.exe
RC=x86_64-w64-mingw32-windres.exe
FLAGS_DLL=-Wall -Os
LDFLAGS_DLL=-s -shared -Wl,--subsystem,windows -static-libstdc++ -static-libgcc -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--enable-auto-import
LIBS=-luser32 -lole32 -luuid
INCLUDES=-I../../include -I../inc -I. -I../utils

HEADERS=WinTools.h\
  SecureFuncs.h\
  resource.h\
  guid.h\
  ExplorerContextMenu.h\
  ExplorerClassFactory.h\
  DllMain.h\
  DbgPrintf.h\
  LangTools.h

SRCS=DllMain.cpp\
    ../utils/DbgPrintf.cpp\
    ExplorerClassFactory.cpp\
    ExplorerContextMenu.cpp\
    ../utils/SecureFuncs.cpp\
    ../utils/WinTools.cpp\
    ../utils/LangTools.cpp

all: ../out/$(TARGETNAME).dll
#	$(STRIP) $<

../out/$(TARGETNAME).dll: ../out/$(TARGETNAME)/res.o $(SRCS)
	$(CC) -o $@ $(FLAGS_DLL) $(LDFLAGS_DLL) $(INCLUDES) $^ $(LIBS)

#../out/$(TARGETNAME)/%.o : %.cpp $(HEADERS)
#	if not exist ..\out\$(TARGETNAME) mkdir ..\out\$(TARGETNAME)
#	${CC} ${CFLAGS_DLL} -c $< -o $@

../out/$(TARGETNAME)/res.o: res.rc
	if not exist ..\out\$(TARGETNAME) mkdir ..\out\$(TARGETNAME)
	$(RC) -o $@ $^

