Makefile 2.6 KB

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