Makefile 852 B

123456789101112131415161718192021222324252627282930313233343536373839
  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/$(OS)/Makefile.am
  9. CFLAGS += -I. -I../include -I../src
  10. subdirs = string stdlib network graphene
  11. objs = $(foreach dir,$(subdirs),$(patsubst %.c,%.o,$(wildcard $(dir)/*.c)))
  12. headers = asm-errlist.h api.h
  13. all: $(target)graphene-lib.a
  14. ifeq ($(DEBUG),1)
  15. CC += -g
  16. CFLAGS += -DDEBUG
  17. endif
  18. $(target)graphene-lib.a: $(addprefix $(target),$(objs))
  19. @echo [ $(notdir $@) ]
  20. @mkdir -p $(dir $@)
  21. @$(AR) $(ARFLAGS) $@ $^
  22. ../src/host_endian.h:
  23. @$(MAKE) -C ../src host_endian.h
  24. $(target)%.o: %.c $(headers) ../src/host_endian.h
  25. @echo [ $(notdir $@) ]
  26. @mkdir -p $(dir $@)
  27. @$(CC) $(CFLAGS) -c $< -o $@
  28. clean:
  29. rm -f $(objs) graphene-lib.a