treebird/Makefile
me@ow.nekobit.net eeffd37e16 Mastodont
FossilOrigin-Name: 5c85e9e9ad0154fc7a1e59c80ecc184b131e3ed6807d0cb46dcd3d4ff898dffb
2022-01-19 01:45:03 +00:00

43 lines
862 B
Makefile

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