Makefile 373 B

123456789101112131415161718192021222324252627
  1. TARGET = helloworld
  2. OUTDIR ?= bin
  3. CC = xcrun -sdk appletvos cc -arch arm64
  4. LDID = ldid
  5. CFLAGS = -Wall
  6. .PHONY: all clean
  7. all: $(OUTDIR)/$(TARGET)
  8. DEBUG ?= 0
  9. ifeq ($(DEBUG), 1)
  10. else
  11. CFLAGS += -O2
  12. endif
  13. $(OUTDIR):
  14. mkdir -p $(OUTDIR)
  15. $(OUTDIR)/$(TARGET): *.c | $(OUTDIR)
  16. $(CC) -o $@ $^ $(CFLAGS)
  17. $(LDID) -SEnt.plist $@
  18. clean:
  19. rm -f $(OUTDIR)/$(TARGET)