makefile.in 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Project Data
  2. PROJECT_NAME=ddlang
  3. EXECUTABLE=${PROJECT_NAME}
  4. # Engine Data
  5. ENGINE_PATH=engines/cglut
  6. ENGINE_OUT=${ENGINE_PATH}/libddcglut.a
  7. INSTALL_LOCATION=@INSTALL_LOCATION@
  8. # Files for compilation
  9. SRC=$(wildcard src/*.c)
  10. YACC_SRC=yacc.tab.c
  11. YACC_HEADER=yacc.tab.h
  12. LEX_SRC=lex.yy.c
  13. # build the executable, depends on source, lex, yacc and all engines
  14. ${EXECUTABLE}: ${SRC} ${YACC_SRC} ${YACC_HEADER} ${LEX_SRC}
  15. gcc -Wall -Wpedantic -Wextra -DINSTALL_LOCATION=\"${INSTALL_LOCATION}\" \
  16. -DPROJECT_NAME=\"${PROJECT_NAME}\" -Iinclude -I. ${SRC} ${YACC_SRC} ${LEX_SRC} -o ${EXECUTABLE}
  17. # how to build lex
  18. ${LEX_SRC}: src/lex.l
  19. flex src/lex.l
  20. # how to build yacc
  21. ${YACC_SRC} ${YACC_HEADER}: src/yacc.y
  22. bison -d src/yacc.y
  23. # how to build the cglut engine
  24. engine:
  25. ${MAKE} -C ${ENGINE_PATH}
  26. install: ${EXECUTABLE}# ${ENGINE_PATH}/${ENGINE}
  27. ${MAKE} -C ${ENGINE_PATH} PREFIX=${INSTALL_LOCATION} install
  28. mkdir -p ${INSTALL_LOCATION}/bin
  29. install ${EXECUTABLE} ${INSTALL_LOCATION}/bin/
  30. #mkdir -p ${INSTALL_LOCATION}/share/${PROJECT_NAME}
  31. #install ${ENGINE_PATH}/${ENGINE} ${INSTALL_LOCATION}/share/${PROJECT_NAME}/${ENGINE}
  32. #install ${ENGINE_PATH}/index.html ${INSTALL_LOCATION}/share/${PROJECT_NAME}/index.html
  33. mkdir -p ${INSTALL_LOCATION}/share/man/man1/
  34. install manual/ddlang.1 ${INSTALL_LOCATION}/share/man/man1/
  35. mkdir -p ${INSTALL_LOCATION}/share/info/
  36. install ddlang.info.gz ${INSTALL_LOCATION}/share/info/
  37. # vim files
  38. mkdir -p ${INSTALL_LOCATION}/share/vim/vimfiles/syntax/
  39. install vim/syntax/ddlang.vim ${INSTALL_LOCATION}/share/vim/vimfiles/syntax/
  40. mkdir -p ${INSTALL_LOCATION}/share/vim/vimfiles/ftdetect/
  41. install vim/ftdetect/ddlang.vim ${INSTALL_LOCATION}/share/vim/vimfiles/ftdetect/
  42. clean:
  43. rm -f ${EXECUTABLE} ${LEX_SRC} ${YACC_SRC} ${YACC_HEADER}
  44. destclean: clean
  45. rm -f ddlang.info.gz makefile
  46. .PHONY: clean destclean install engine