Makefile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #
  2. # MinGW 32 makefile
  3. #
  4. # Change vars MINGW and MINREL in accord to your compiler path/release
  5. #
  6. MINGW =C:/MinGW32
  7. MINREL =4.7.2
  8. #
  9. #
  10. CPP = g++.exe
  11. CC = gcc.exe
  12. TEMP =../../lib_tmp
  13. OBJ = $(TEMP)/win32/lv_snap7.o
  14. LINKOBJ = $(TEMP)/win32/lv_snap7.o
  15. LIBS = -L"$(MINGW)/lib" -static-libgcc --no-export-all-symbols --add-stdcall-alias $(MINGW)/lib/gcc/mingw32/$(MINREL)/libstdc++.a ../../../release/windows/win32/snap7.lib
  16. CXXINCS = -I"$(MINGW)/include"
  17. OUTPATH = ../../lib/win32/
  18. DLL = lv_snap7.dll
  19. OUTLIB = $(TEMP)/lv_snap7.lib
  20. BIN = $(OUTPATH)$(DLL)
  21. CXXFLAGS = $(CXXINCS) -DBUILDING_DLL=1 -Ofast -pedantic
  22. RM = rm -f
  23. .PHONY: all all-before all-after clean clean-custom
  24. all: all-before $(BIN) all-after
  25. DLLWRAP=dllwrap.exe
  26. DLLTOOL=dlltool.exe
  27. DEFFILE=$(OUTPATH)lv_snap7.def
  28. clean: clean-custom
  29. ${RM} $(OBJ) $(BIN) $(OUTLIB) $(DEFFILE)
  30. $(BIN): $(LINKOBJ)
  31. $(DLLWRAP) --output-def $(DEFFILE) --driver-name c++ $(LINKOBJ) $(LIBS) -o $(BIN)
  32. $(TEMP)/win32/lv_snap7.o: ../../lib_src/lv_snap7.cpp
  33. $(CPP) -c ../../lib_src/lv_snap7.cpp -o $(TEMP)/win32/lv_snap7.o $(CXXFLAGS)
  34. all-after:
  35. $(DLLTOOL) -D $(DLL) -d $(DEFFILE) -l $(OUTLIB)