Makefile 642 B

123456789101112131415161718192021
  1. rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
  2. SOURCES := $(call rwildcard,src/,*.c)
  3. HEADERS := $(call rwildcard,src/,*.h)
  4. PREFIX = /usr/local
  5. .PHONY: install clean
  6. ntc: $(SOURCES) $(HEADERS)
  7. ifdef OW
  8. wcl386 -ml $(if $(GAS),-DSYNTAX_GAS=1,) $(if $(DEBUG),-DDEBUG=1,) -fe="ntc.exe" -bt=dos -l=dos4g -ml $(if $(DEBUG),,-d0 -os -om -ob -oi -ol -ox) -lr -za99 -i=src $(SOURCES)
  9. else
  10. cc $(if $(GAS),-DSYNTAX_GAS=1,) $(if $(DEBUG),-DDEBUG=1,) -Wall -o ntc -fno-PIE -no-pie -std=gnu11 $(if $(DEBUG),-O0 -g,-Os -s) -fms-extensions -Isrc $(SOURCES)
  11. endif
  12. install: ntc
  13. mv ./ntc $(PREFIX)/bin
  14. clean:
  15. rm ./ntc