Makefile 661 B

123456789101112131415161718192021222324252627282930313233
  1. ARTIFACT = client-tls
  2. #Build architecture/variant string, possible values: x86, armv7le, etc...
  3. PLATFORM = armv7le
  4. OUTPUT_DIR = build
  5. TARGET = $(ARTIFACT)
  6. CC ?= qcc -Vgcc_nto$(PLATFORM)
  7. CXX = qcc -lang-c++ -Vgcc_nto$(PLATFORM)
  8. LD = $(CC)
  9. INCLUDES += -I../../../
  10. LIBS += -L../../../src/.libs/ -lwolfssl
  11. LIBS += -lsocket -lm
  12. CCFLAGS += -O2 -Wall
  13. SRCS = client-tls.c
  14. OBJS = $(addprefix $(OUTPUT_DIR)/,$(addsuffix .o, $(basename $(SRCS))))
  15. $(OUTPUT_DIR)/%.o: %.c
  16. @mkdir -p $(dir $@)
  17. $(CC) -c -o $@ $(INCLUDES) $(CCFLAGS) $<
  18. $(TARGET):$(OBJS)
  19. $(LD) -o $(TARGET) $(OBJS) $(LIBS)
  20. all: $(TARGET)
  21. clean:
  22. rm -rf $(OUTPUT_DIR) $(ARTIFACT)
  23. rebuild: clean all