Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. include ../src/Makefile.Host
  2. CC = gcc
  3. AR = ar rcs
  4. CFLAGS = -Wall -fPIC -O2 -std=gnu99 -fgnu89-inline -U_FORTIFY_SOURCE \
  5. -fno-omit-frame-pointer \
  6. -fno-stack-protector -fno-builtin
  7. ARFLAGS =
  8. include ../src/host/$(PAL_HOST)/Makefile.am
  9. CFLAGS += -I. -I../include -I../src
  10. subdirs = string stdlib network graphene util crypto
  11. headers = api.h
  12. # Select which crypto adpater you want to use here. This has to match
  13. # the #define in pal_crypto.h.
  14. subdirs += crypto/mbedtls
  15. #subdirs += crypto/wolfssl
  16. objs = $(foreach dir,$(subdirs),$(patsubst %.c,%.o,$(wildcard $(dir)/*.c)))
  17. objs += crypto/adapters/mbedtls_adapter.o
  18. #objs += crypto/adapters/wolfssl_adapter.o
  19. all: $(target)graphene-lib.a
  20. ifeq ($(DEBUG),1)
  21. CC += -g
  22. CFLAGS += -DDEBUG
  23. endif
  24. $(target)graphene-lib.a: $(addprefix $(target),$(objs))
  25. @echo [ $(notdir $@) ]
  26. @mkdir -p $(dir $@)
  27. @$(AR) $(ARFLAGS) $@ $^
  28. ../src/host_endian.h:
  29. @$(MAKE) -C ../src host_endian.h
  30. $(target)%.o: %.c $(headers) ../src/host_endian.h
  31. @echo [ $(notdir $@) ]
  32. @mkdir -p $(dir $@)
  33. @$(CC) $(CFLAGS) -c $< -o $@
  34. clean:
  35. rm -f $(objs) graphene-lib.a