Partial compilation
This commit is contained in:
parent
ba6f9fb6c1
commit
9e04938065
18
Makefile
18
Makefile
@ -3,19 +3,25 @@ rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
|
|||||||
SOURCES := $(call rwildcard,src/,*.c)
|
SOURCES := $(call rwildcard,src/,*.c)
|
||||||
HEADERS := $(call rwildcard,src/,*.h)
|
HEADERS := $(call rwildcard,src/,*.h)
|
||||||
|
|
||||||
|
OBJECTS := $(patsubst src/%.c,build/%.o,$(SOURCES))
|
||||||
|
DEPS := $(patsubst build/%.o,build/%.d,$(OBJECTS))
|
||||||
|
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
|
|
||||||
|
CFLAGS = $(if $(DEBUGA),-DDEBUG=1,) -Wall $(if $(ASAN),-fsanitize=address,) -fno-PIE -no-pie -std=gnu11 $(if $(DEBUG),-O0 -g,-Os -s) -fms-extensions -Isrc -Wno-array-bounds -MMD -MP -flto
|
||||||
|
|
||||||
.PHONY: install clean
|
.PHONY: install clean
|
||||||
|
|
||||||
ntc: $(SOURCES) $(HEADERS)
|
build/%.o: src/%.c
|
||||||
ifdef OW
|
cc -c $(CFLAGS) -o $@ $<
|
||||||
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)
|
|
||||||
else
|
ntc: $(OBJECTS)
|
||||||
cc $(if $(GAS),-DSYNTAX_GAS=1,) $(if $(DEBUGA),-DDEBUG=1,) -Wall -o ntc -fsanitize=address -fno-PIE -no-pie -std=gnu11 $(if $(DEBUG),-O0 -g,-Os -s) -fms-extensions -Isrc $(SOURCES) -Wno-array-bounds
|
cc $(CFLAGS) -o ntc $(OBJECTS)
|
||||||
endif
|
|
||||||
|
|
||||||
install: ntc
|
install: ntc
|
||||||
mv ./ntc $(PREFIX)/bin
|
mv ./ntc $(PREFIX)/bin
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm ./ntc
|
rm ./ntc
|
||||||
|
|
||||||
|
-include $(DEPS)
|
||||||
|
Loading…
Reference in New Issue
Block a user