Makefile 821 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. UNAME := $(shell uname)
  2. ifeq ($(UNAME), Linux)
  3. ifndef PLATFORM
  4. PLATFORM = i686
  5. endif
  6. CC = $(PLATFORM)-w64-mingw32-g++
  7. CXX = $(PLATFORM)-w64-mingw32-g++
  8. LINK = $(PLATFORM)-w64-mingw32-ld
  9. else
  10. CC = g++
  11. CXX = g++
  12. LINK = ld
  13. endif
  14. RM = rm
  15. CFLAGS = -Wall -g
  16. LDFLAGS = -static
  17. ifdef UNICODE
  18. CFLAGS += -DUNICODE -D_UNICODE
  19. endif
  20. OBJ = DllLoader.o ../../MemoryModule.o
  21. OBJ_LOADER = DllLoaderLoader.o ../../MemoryModule.o
  22. all: DllLoader.exe DllLoaderLoader.exe
  23. DllLoader.exe: $(OBJ)
  24. $(CC) $(LDFLAGS) -Wl,--image-base -Wl,0x20000000 -o DllLoader.exe $(OBJ)
  25. DllLoaderLoader.exe: $(OBJ_LOADER)
  26. $(CC) $(LDFLAGS) -Wl,--image-base -Wl,0x10000000 -o DllLoaderLoader.exe $(OBJ_LOADER)
  27. %.o: %.cpp
  28. $(CXX) $(CFLAGS) -c $<
  29. %.o: %.cc
  30. $(CC) $(CFLAGS) -c $<
  31. clean:
  32. $(RM) -rf $(OBJ) $(OBJ_LOADER) DllLoader.exe DllLoaderLoader.exe