diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3bf64dd --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "mastodont"] + path = mastodont + url = https://git.nekobit.net/mastodont-c.git/ diff --git a/Makefile b/Makefile index 2cc207e..96cb5c3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ CC ?= cc +GIT ?= git CFLAGS = -Wall LDFLAGS = -lcurl SRC = $(wildcard src/*.c) @@ -9,7 +10,12 @@ PAGES_CMP = $(patsubst %.html,%.chtml,$(PAGES)) DIST = dist/ TARGET = ratfe.cgi -all: $(TARGET) +# 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) @@ -23,6 +29,10 @@ filec: src/file-to-c/main.o $(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 $@