Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. INSTALL = /usr/bin/env install
  2. DEST =
  3. PREFIX = /usr/local
  4. BINDIR = $(PREFIX)/bin
  5. LIBDIR = $(PREFIX)/lib
  6. MANDIR = $(PREFIX)/share/man
  7. CC = gcc
  8. CXX = g++
  9. CFLAGS = -pipe -march=x86-64 -mtune=generic -O2 -pipe -fprofile-arcs -fstack-protector --param=ssp-buffer-size=4 -Wall
  10. CXXFLAGS= -pipe -std=c++11 -march=x86-64 -mtune=generic -O2 -pipe -fprofile-arcs -fstack-protector -ftest-coverage --param=ssp-buffer-size=4 -Wall
  11. LINK = g++
  12. LFLAGS = -Wl,-O1,--sort-common,--as-needed,-z,relro -Wl,-O1
  13. LIBS = -lssh2 -lyaml -lgcov -larchive
  14. INCPATH = -I/usr/include -Iinclude
  15. DEL = rm -f
  16. DEL_R = rm -r
  17. SRC = src/dist.cpp \
  18. src/gen.cpp \
  19. src/interface.cpp \
  20. src/parser.cpp \
  21. src/profile.cpp \
  22. src/remote.cpp \
  23. src/yabs.cpp
  24. OBJ = dist.o \
  25. gen.o \
  26. interface.o \
  27. parser.o \
  28. profile.o \
  29. remote.o \
  30. yabs.o
  31. TRGT = yabs
  32. first: all
  33. .SUFFIXES: .o .c .cpp .cc .cxx .C
  34. .cpp.o:
  35. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
  36. .cc.o:
  37. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
  38. .cxx.o:
  39. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
  40. .C.o:
  41. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
  42. .c.o:
  43. $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
  44. all: $(TRGT)
  45. $(TRGT): $(OBJ)
  46. $(CXX) $(LFLAGS) -o $(TRGT) $(OBJ) $(LIBS)
  47. dist.o: src/dist.cpp
  48. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o dist.o src/dist.cpp
  49. gen.o: src/gen.cpp
  50. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o gen.o src/gen.cpp
  51. interface.o: src/interface.cpp
  52. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o interface.o src/interface.cpp
  53. parser.o: src/parser.cpp
  54. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o parser.o src/parser.cpp
  55. profile.o: src/profile.cpp
  56. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o profile.o src/profile.cpp
  57. remote.o: src/remote.cpp
  58. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o remote.o src/remote.cpp
  59. yabs.o: src/yabs.cpp
  60. $(CXX) -c $(CXXFLAGS) $(INCPATH) -o yabs.o src/yabs.cpp
  61. clean:
  62. $(DEL) $(OBJ)
  63. $(DEL) yabs
  64. $(DEL) *~ core *.core
  65. $(DEL) *.gcno *.gcda *.gcov
  66. tests:
  67. ./test/test-script.sh basic-color
  68. ./test/test-script.sh memory-color
  69. install:
  70. $(INSTALL) -d $(DEST)$(BINDIR)
  71. $(INSTALL) -d $(DEST)$(LIBDIR)/yabs
  72. $(INSTALL) -d $(DEST)$(MANDIR)/man1
  73. $(INSTALL) -m755 yabs $(DEST)$(BINDIR)/yabs
  74. $(INSTALL) -m644 doc/yabs.1 $(DEST)$(MANDIR)/man1/yabs.1
  75. uinstall:
  76. rm -f $(DEST)/yabs
  77. rm -f $(DEST)$(MANDIR)man1/yabs.1