Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Windows did not have basename, so i took my extension grabber program from edabit and modified it
  2. # to get the basename of a file without an extension. Basename is now installed in the windows
  3. # System32 folder to be used ANYWHERE on the computer.
  4. #
  5. # make has a default recipe that uses the target & prequisite to build files
  6. # % is used as a substitution for any variable. $< is used to substitute the prerequisite
  7. # %.exe matches the default target rule which is what make is being asked to build.
  8. # the variable can be accessed using $@
  9. # : seperates the target from target prerequisite(s) %.cpp represents what is needed to build the exe
  10. # "g++ $< -o $(basename $@)/$@" is the recipe used by Make to compile the exe
  11. # the default build rule %.exe will follow this example: make lame.exe will generate the recipe
  12. # g++ lame.exe -o lame/lame.exe
  13. OUTPUT_FOLDER = $(basename $@)
  14. .PHONY : clean
  15. # all: ; $(foreach v, $(.VARIABLE), $(info $(v) = $($(v))))
  16. # info :
  17. # $(foreach v, $(.VARIABLE), $(info $(v) = $($(v))))
  18. %.exe : %.cpp
  19. g++ $< -o $(basename $@)\$@
  20. clean :
  21. del $(basename $(f))\$(f)
  22. # cp was not working in powershell, it has to be copy. line endings matter for some programs
  23. # to remove ambiguity from the copy command, quotes are necessary to put around the destination path to specify it was a directory and not a file
  24. url2file.exe : url2file.c url2file/libpng16.dll url2file/libcurl.dll
  25. g++ $< -L $(ow)/lib/ -I $(ow)/include/ -lcurl -o $(basename $@)/$@
  26. libharuEXMP.exe : libharuEXMP.cpp libharuEXMP/libpng16.dll libharuEXMP/libhpdf.dll
  27. g++ $< -L $(ow)/lib/ -I $(ow)/include/ -lhpdf -o $(basename $@)/$@
  28. # to read more about make variables - chapter 10.5.3, automatic variables in GNU Make manual
  29. %.dll :
  30. copy $(ow)\bin\$(@F) "$(@D)\"
  31. cleanPDFtest.exe : cleanPDFtest.cpp cleanPDFtest/libpng16.dll cleanPDFtest/libhpdf.dll
  32. g++ $< -L $(ow)/lib/ -I $(ow)/include/ -lhpdf -o $(basename $@)/$@
  33. pdfHummusTest1.exe : pdfHummusTest1.cpp
  34. g++ -I C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/include $< -L C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/objs -lall -o $(basename $@)/$@