Makefile 668 B

123456789101112131415161718192021222324252627282930313233
  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
  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: graphene-lib.a
  14. debug: CC = gcc -g
  15. debug: CFLAGS += -DDEBUG
  16. debug: graphene-lib.a
  17. graphene-lib.a: $(objs)
  18. @echo [ $@ ]
  19. @$(AR) $(ARFLAGS) $@ $^
  20. %.o: %.c $(headers)
  21. @echo [ $@ ]
  22. @$(CC) $(CFLAGS) -c $< -o $@
  23. clean:
  24. rm -f $(objs) graphene-lib.a