Makefile 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 crypto/mbedtls
  11. objs = $(foreach dir,$(subdirs),$(patsubst %.c,%.o,$(wildcard $(dir)/*.c)))
  12. headers = api.h
  13. # Select which crypto adpater you want to use here. This has to match
  14. # the #define in pal_crypto.h.
  15. objs += crypto/adapters/mbedtls_adapter.o
  16. #objs += crypto/adapters/wolfssl_adapter.o
  17. all: $(target)graphene-lib.a
  18. ifeq ($(DEBUG),1)
  19. CC += -g
  20. CFLAGS += -DDEBUG
  21. endif
  22. $(target)graphene-lib.a: $(addprefix $(target),$(objs))
  23. @echo [ $(notdir $@) ]
  24. @mkdir -p $(dir $@)
  25. @$(AR) $(ARFLAGS) $@ $^
  26. ../src/host_endian.h:
  27. @$(MAKE) -C ../src host_endian.h
  28. $(target)%.o: %.c $(headers) ../src/host_endian.h
  29. @echo [ $(notdir $@) ]
  30. @mkdir -p $(dir $@)
  31. @$(CC) $(CFLAGS) -c $< -o $@
  32. clean:
  33. rm -f $(objs) graphene-lib.a