Makefile 876 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. debug: CC = gcc -g
  15. debug: CFLAGS += -DDEBUG
  16. debug: $(target)graphene-lib.a
  17. $(target)graphene-lib.a: $(addprefix $(target),$(objs))
  18. @echo [ $(notdir $@) ]
  19. @mkdir -p $(dir $@)
  20. @$(AR) $(ARFLAGS) $@ $^
  21. ../src/host_endian.h:
  22. @$(MAKE) -C ../src host_endian.h
  23. $(target)%.o: %.c $(headers) ../src/host_endian.h
  24. @echo [ $(notdir $@) ]
  25. @mkdir -p $(dir $@)
  26. @$(CC) $(CFLAGS) -c $< -o $@
  27. clean:
  28. rm -f $(objs) graphene-lib.a