2
0

Makefile 637 B

12345678910111213141516171819202122232425
  1. .PHONY: default clean
  2. LDLIBS=
  3. CFLAGS=-g -O0
  4. OS_NAME = $(shell uname -s)
  5. ST_TARGET = linux-debug
  6. ifeq ($(OS_NAME), Darwin)
  7. ST_TARGET = darwin-debug
  8. CPU_ARCHS = $(shell g++ -dM -E - </dev/null |grep -q '__x86_64' && echo x86_64)
  9. CPU_ARCHS += $(shell g++ -dM -E - </dev/null |grep -q '__aarch64' && echo arm64)
  10. CFLAGS += -arch $(CPU_ARCHS)
  11. endif
  12. default: ./jmpbuf ./jmpbuf.E.txt
  13. ./jmpbuf: jmpbuf.c $(LDLIBS)
  14. $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -o $@ $^ $(LDLIBS)
  15. ./jmpbuf.E.txt: jmpbuf.c
  16. $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Wall -E -o jmpbuf.E.txt $^ $(LDLIBS)
  17. clean:
  18. rm -rf jmpbuf jmpbuf.E.txt jmpbuf.dSYM