CC ?= cc GIT ?= git CFLAGS = -Wall LDFLAGS = -lcurl SRC = $(wildcard src/*.c) OBJ = $(patsubst %.c,%.o,$(SRC)) PAGES_DIR = static PAGES = $(wildcard $(PAGES_DIR)/*.html) PAGES_CMP = $(patsubst %.html,%.chtml,$(PAGES)) DIST = dist/ TARGET = ratfe.cgi # Mastodont MASTODONT = mastodont/ MASTODONT_REPO = https://git.nekobit.net/repos/mastodont-c.git all: mastodont $(TARGET) mastodont: $(MASTODONT) $(TARGET): filec $(PAGES_CMP) $(OBJ) $(CC) -o $(DIST)$(TARGET) $(LDFLAGS) $(OBJ) filec: src/file-to-c/main.o $(CC) -o file-to-c $< %.chtml: %.html ./file-to-c $< $< > $@ $(PAGES_DIR)/index.chtml: $(PAGES_DIR)/index.html ./file-to-c $< data_index_html > $@ $(MASTODONT): $(GIT) submodule foreach git pull make -C $(MASTODONT) %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ clean: rm -f $(OBJ) src/file-to-c/main.o rm -f $(PAGES_CMP) .PHONY: all filec clean