diff --git a/.gitignore b/.gitignore index 709101d..07c8463 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ filec **/*.cgi **/*.o **/*.chtml +mastodont-c/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 3bf64dd..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "mastodont"] - path = mastodont - url = https://git.nekobit.net/mastodont-c.git/ diff --git a/Makefile b/Makefile index 2016793..5e113b6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CC ?= cc GIT ?= git -MASTODONT_DIR = mastodont/ +MASTODONT_DIR = mastodont-c/ MASTODONT = $(MASTODONT_DIR)libmastodont.a CFLAGS = -Wall -I $(MASTODONT_DIR)include/ LDFLAGS = -L$(MASTODONT_DIR) -lcurl -lmastodont @@ -12,7 +12,9 @@ PAGES_CMP = $(patsubst %.html,%.chtml,$(PAGES)) DIST = dist/ TARGET = ratfe.cgi -all: $(MASTODONT) $(TARGET) +MASTODONT_URL = https://git.nekobit.net/repos/mastodont-c.git + +all: $(MASTODONT_DIR) $(TARGET) $(TARGET): filec $(PAGES_CMP) $(OBJ) $(CC) -o $(DIST)$(TARGET) $(OBJ) $(LDFLAGS) @@ -26,10 +28,14 @@ filec: src/file-to-c/main.o $(PAGES_DIR)/index.chtml: $(PAGES_DIR)/index.html ./filec $< data_index_html > $@ -$(MASTODONT): - $(GIT) submodule update --init --recursive +$(MASTODONT_DIR): + git clone $(MASTODONT_URL) + @echo -e "\033[38;5;13mRun 'make update' to update mastodont-c\033[0m" make -C $(MASTODONT_DIR) +update: + git -C $(MASTODONT_DIR) pull + %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ @@ -39,4 +45,9 @@ clean: rm -f filec make -C $(MASTODONT_DIR) clean -.PHONY: all filec clean +clean_deps: + rm -r $(MASTODONT_DIR) + +clean_all: clean clean_deps + +.PHONY: all filec clean update clean clean_deps clean_all