From ebaac88d361f71f7246b6f7bc1062a8530894806 Mon Sep 17 00:00:00 2001 From: "me@ow.nekobit.net" Date: Thu, 20 Jan 2022 00:02:51 +0000 Subject: [PATCH] Don't use modules They are too buggy with our usecase, because I also want to be able to link my own mastodont repository for development purposes FossilOrigin-Name: 935c9b8b31082ab006560522d1eb2f4c54dd1507c3f1fc209e42c5a4bbc53a24 --- .gitignore | 1 + .gitmodules | 3 --- Makefile | 21 ++++++++++++++++----- 3 files changed, 17 insertions(+), 8 deletions(-) delete mode 100644 .gitmodules 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