Makefile 448 B

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