1
1

Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. # -gdwarf-2 for debug information for intel VTune Profiler.
  19. %.exe : $(p)\%.cpp
  20. g++ $< -g3 -gdwarf-4 -o $(p)\$(basename $@)\$@
  21. clean :
  22. # del $(basename $(f))\$(f)
  23. '$(ProgramFiles)/Git/usr/bin/rm.exe' -rf $(p)\$(basename $(f))\$(f)
  24. # cp was not working in powershell, it has to be copy. line endings matter for some programs
  25. # 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
  26. url2file.exe : url2file.c url2file/libpng16.dll url2file/libcurl.dll
  27. g++ $< -L $(ow)/lib/ -I $(ow)/include/ -lcurl -o $(basename $@)/$@
  28. libharuEXMP.exe : libharuEXMP.cpp libharuEXMP/libpng16.dll libharuEXMP/libhpdf.dll
  29. g++ $< -L $(ow)/lib/ -I $(ow)/include/ -lhpdf -o $(basename $@)/$@
  30. # to read more about make variables - chapter 10.5.3, automatic variables in GNU Make manual
  31. %.dll :
  32. copy $(ow)\bin\$(@F) "$(@D)\"
  33. cleanPDFtest.exe : cleanPDFtest.cpp cleanPDFtest/libpng16.dll cleanPDFtest/libhpdf.dll
  34. g++ $< -L $(ow)/lib/ -I $(ow)/include/ -lhpdf -o $(basename $@)/$@
  35. BasicImageAndText.exe pdfHummusTest1.exe PauseAndContinue.exe :
  36. g++ -g -I C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/include $(@:.exe=.cpp) -L C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/objs -lall -o $(basename $@)/$@
  37. # also make the object file for debugging reasons
  38. # g++ -I C:/Users/bad-p/Downloads/PDFHummus-build/PDFWriter/include -c $(@:.exe=.cpp) -o $(basename $@)/$(@:.exe=.o)