ciabatta/makefile

28 lines
573 B
Makefile
Raw Normal View History

2022-06-02 05:18:26 +00:00
2022-06-02 23:41:48 +00:00
# TODO: make shell variable-based path
CLFLAGS=/X /GS- /Iinc /Icode $(shell test\inctoarg)
2022-06-02 05:18:26 +00:00
2022-06-02 23:41:48 +00:00
CC=clang-cl
CFLAGS=$(CLFLAGS)
LDFLAGS=/nologo /nodefaultlib /entry:mainCRTStartup /subsystem:console
2022-06-02 05:18:26 +00:00
SRC_DIR := code
OBJ_DIR := build
SRC_FILES := $(wildcard $(SRC_DIR)/*.c)
2022-06-02 19:55:10 +00:00
OBJ_FILES := $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.obj,$(SRC_FILES))
2022-06-02 05:18:26 +00:00
ciabatta.lib: $(OBJ_FILES)
2022-06-02 19:55:10 +00:00
lib $(LDFLAGS) /out:$@ $^
2022-06-02 05:18:26 +00:00
2022-06-02 23:43:21 +00:00
$(OBJ_DIR)/%.obj: $(SRC_DIR)/%.c
2022-06-02 23:41:48 +00:00
$(CC) -c -o $@ $< $(CFLAGS)
2022-06-02 05:18:26 +00:00
2022-06-02 23:41:48 +00:00
clean:
del /F /Q build\*
del /F /Q lib\ciabatta.lib
inctoarg:
cl test\inctoarg.c
.PHONY: inctoarg ciabatta.lib