Makefile.env 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. CC = gcc
  2. CFLAGS = -Wall -Wextra -ansi -pedantic -I.. -I../libsfn
  3. ifeq ($(DEBUG),)
  4. CFLAGS += -O3
  5. else
  6. CFLAGS += -g
  7. endif
  8. # autodetect configuration
  9. ifneq ($(USE_DYNDEPS),)
  10. ifneq ("$(wildcard /usr/local/include/libimagequant.h)","")
  11. CFLAGS += -DHAS_QUANT=1 -I/usr/local/include
  12. LIBS += -L/usr/local/lib -limagequant
  13. else
  14. ifneq ("$(wildcard /usr/include/libimagequant.h)","")
  15. CFLAGS += -DHAS_QUANT=1
  16. LIBS += -limagequant
  17. endif
  18. endif
  19. ifneq ("$(wildcard /usr/local/include/freetype2/ft2build.h)","")
  20. CFLAGS += -DHAS_FT=1 -I/usr/local/include/freetype2
  21. LIBS += -L/usr/local/lib -lfreetype
  22. else
  23. ifneq ("$(wildcard /usr/include/freetype2/ft2build.h)","")
  24. CFLAGS += -DHAS_FT=1 -I/usr/include/freetype2
  25. LIBS += -lfreetype
  26. endif
  27. endif
  28. else
  29. ifeq ($(TARGET),)
  30. CFLAGS += -I../libsfn/libimagequant -I../libsfn/freetype2/include -DHAS_QUANT=1 -DHAS_FT=1
  31. EXTRA += ../libsfn/libimagequant/*.o ../libsfn/freetype2/objs/*.o
  32. else
  33. ifneq ("$(wildcard ../libsfn/libimagequant/*.o)","")
  34. EXTRA += ../libsfn/libimagequant/*.o
  35. else
  36. LIBS += -limagequant
  37. endif
  38. ifneq ("$(wildcard ../libsfn/freetype2/objs/*.o)","")
  39. EXTRA += ../libsfn/freetype2/objs/*.o
  40. else
  41. LIBS += -lfreetype
  42. endif
  43. endif
  44. endif