Makefile.in 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. # Files
  2. HEADERS = $(wildcard src/*.h)
  3. SRC = $(wildcard src/*.cpp)
  4. OBJ = ${SRC:.cpp=.o}
  5. # Project data
  6. name = dargite3d
  7. version = 1.0.0
  8. EXE = share/dargite3d/${name}
  9. # Compiler arguments
  10. CC = g++
  11. CFLAGS = -Wall -Wextra -pedantic
  12. LIBS = -lglut -lGL -lGLU -lGLEW
  13. ### Rules ###
  14. # Executable
  15. ${EXE}: ${OBJ}
  16. $(CC) $(CFLAGS) -o $@ $(OBJ) $(LIBS)
  17. tarball:
  18. @echo Making tarball ${name}-${version}.tar.gz
  19. @tar -czf $(name)-$(version).tar.gz bin/* LICENSE Makefile \
  20. share/* README.md ${SRC} ${HEADERS} --exclude=bin/dargite3d \
  21. --exclude=${EXE} configure Makefile.in
  22. install: ${EXE}
  23. @echo Installing project to ${DEST_DIR}@APP_DIR ...
  24. @mkdir -p ${DEST_DIR}@APP_DIR/share
  25. @cp -rf share/dargite3d/ ${DEST_DIR}@APP_DIR/share/
  26. @chmod 755 ${DEST_DIR}@APP_DIR/share/dargite3d/${name}
  27. @mkdir -p ${DEST_DIR}@APP_DIR/bin
  28. @cp -f bin/dargite3d ${DEST_DIR}@APP_DIR/bin
  29. @chmod 755 ${DEST_DIR}@APP_DIR/bin/dargite3d
  30. @echo Project installed!
  31. uninstall:
  32. @echo removing executable from @APP_DIR
  33. @rm -f @APP_DIR/share/dargite3d @APP_DIR/bin/${name}
  34. clean:
  35. @echo Cleaning ...
  36. @-rm -f bin/dargite3d ${EXE} $(OBJ) Makefile
  37. @-rm -f $(name)-$(version).tar.gz
  38. .PHONY : tarball clean install uninstall
  39. # Re-compile when any header changes
  40. ${OBJ}: ${HEADERS}
  41. # How to compile cpp files
  42. .cpp.o:
  43. ${CC} ${CFLAGS} -c -o ${<:.cpp=.o} $< ${LIBS}