Compile pages

FossilOrigin-Name: 40d7ae05ad3543176e66ed09710b64f5fe38cf52e49f8b3b5cd090c9359eda4d
This commit is contained in:
me@ow.nekobit.net 2022-01-17 02:06:25 +00:00
parent 4ba9eaaafc
commit b48a08ff19
2 changed files with 13 additions and 2 deletions

3
.gitignore vendored
View file

@ -1,3 +1,4 @@
file-to-c
**/*.cgi
**/*.o
**/*.o
**/*.chtml

View file

@ -3,21 +3,31 @@ 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
all: $(TARGET)
$(TARGET): filec $(OBJ)
$(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 > $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJ) src/file-to-c/main.o
rm -f $(PAGES_CMP)
.PHONY: all filec clean