Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. PREFIX = /usr/local
  2. MANDIR = $(PREFIX)/share/man
  3. CDEBUGFLAGS = -Os -g -Wall -Idecrypt-lib/
  4. DEFINES = $(PLATFORM_DEFINES)
  5. CFLAGS = $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES)
  6. LDLIBS = -lrt
  7. LDLIBS += -D_FILE_OFFSET_BITS=64
  8. LDLIBS += -Ldecrypt-lib
  9. # dynamic libraries
  10. LDLIBS += decrypt-lib/libmbedcrypto.so
  11. LDLIBS += decrypt-lib/libmbedx509.so
  12. LDLIBS += decrypt-lib/libmbedtls.so
  13. # using static libraries:
  14. #LDLIBS += decrypt-lib/libmbedcrypto.a
  15. #LDLIBS += decrypt-lib/libmbedx509.a
  16. #LDLIBS += decrypt-lib/libmbedtls.a
  17. SRCS = babeld.c net.c kernel.c util.c interface.c source.c neighbour.c \
  18. route.c xroute.c message.c resend.c configuration.c local.c \
  19. disambiguation.c rule.c \
  20. decrypt.c \
  21. lorauth.c
  22. OBJS = babeld.o net.o kernel.o util.o interface.o source.o neighbour.o \
  23. route.o xroute.o message.o resend.o configuration.o local.o \
  24. disambiguation.o rule.o \
  25. decrypt.o \
  26. lorauth.o
  27. babeld: decrypt-lib $(OBJS)
  28. $(CC) $(CFLAGS) $(LDFLAGS) -o babeld $(OBJS) $(LDLIBS)
  29. babeld.o: babeld.c version.h
  30. local.o: local.c version.h
  31. kernel.o: kernel_netlink.c kernel_socket.c
  32. version.h:
  33. ./generate-version.sh > version.h
  34. # decrypt.o: decrypt.c
  35. # @echo "-- decrypt utils"
  36. # $(CC) -Idecrypt-lib/ -D_FILE_OFFSET_BITS=64 -O2 decrypt.c \
  37. # -Ldecrypt-lib/ \
  38. # decrypt-lib/libmbedcrypto.a \
  39. # decrypt-lib/libmbedx509.a \
  40. # decrypt-lib/libmbedtls.a
  41. .SUFFIXES: .man .html
  42. .man.html:
  43. mandoc -Thtml $< > $@
  44. babeld.html: babeld.man
  45. decrypt-lib:
  46. @echo "Building decryption libraries..."
  47. $(MAKE) -C decrypt-lib all SHARED=True
  48. decrypt_tests: decrypt-lib
  49. @echo "... building decrypt_tests (static)"
  50. $(CC) -o decrypt_tests -Idecrypt-lib/ -D_FILE_OFFSET_BITS=64 -O2 decrypt_tests.c -L./decrypt-lib ./decrypt-lib/libmbedcrypto.a decrypt-lib/libmbedx509.a decrypt-lib/libmbedtls.a
  51. .PHONY: all install install.minimal uninstall clean decrypt-lib
  52. all: babeld babeld.man decrypt-lib \
  53. #decrypt_tests # pruebas de descifrado
  54. install.minimal: babeld
  55. -rm -f $(TARGET)$(PREFIX)/bin/babeld
  56. mkdir -p $(TARGET)$(PREFIX)/bin
  57. cp -f babeld $(TARGET)$(PREFIX)/bin
  58. install: install.minimal all
  59. mkdir -p $(TARGET)$(MANDIR)/man8
  60. cp -f babeld.man $(TARGET)$(MANDIR)/man8/babeld.8
  61. uninstall:
  62. -rm -f $(TARGET)$(PREFIX)/bin/babeld
  63. -rm -f $(TARGET)$(MANDIR)/man8/babeld.8
  64. clean:
  65. #$(MAKE) -C decrypt-lib clean
  66. -rm -f decrypt_tests
  67. -rm -f babeld babeld.html version.h *.o *~ core TAGS gmon.out
  68. distclean:
  69. $(MAKE) -C decrypt-lib clean
  70. -rm -f decrypt_tests
  71. -rm -f babeld babeld.html version.h *.o *~ core TAGS gmon.o