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
This commit is contained in:
me@ow.nekobit.net 2022-01-20 00:02:51 +00:00
parent 7c7de1ffb5
commit ebaac88d36
3 changed files with 17 additions and 8 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@ filec
**/*.cgi
**/*.o
**/*.chtml
mastodont-c/

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "mastodont"]
path = mastodont
url = https://git.nekobit.net/mastodont-c.git/

View file

@ -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