skiqqy.xyz/Makefile

42 lines
911 B
Makefile
Raw Normal View History

2020-05-03 13:33:48 +00:00
# Makefile for blog
CC=gcc
FLAGS=-Wall -pedantic
EXE=bin/GenBlog
2020-10-23 23:45:13 +00:00
all: comp blog build
comp: install
2020-05-03 13:33:48 +00:00
$(CC) $(FLAGS) src/GenBlog.c -o $(EXE)
debug: install
$(CC) $(FLAGS) -DDEBUG src/GenBlog.c -o $(EXE)
2020-05-03 13:33:48 +00:00
install:
mkdir -p bin
mkdir -p blogs
2020-05-03 13:33:48 +00:00
clean:
2020-05-03 18:47:39 +00:00
rm -rf blogs/*.html
rm -rf ./blogs.html
2020-05-03 13:33:48 +00:00
rm -rf bin
2020-10-23 23:45:13 +00:00
build:
./build.sh
blog: comp
@# Reset all blogs to start build.
@# Setup boilerplate html files for blog files
-@for blog in ./blogs/RawBlogs/*.blog ; do \
blog=$$(echo $$blog | cut -c 17- | cut -d "." -f 1); \
cp ./blogs/preamble/start.html ./blogs/$$blog.html; \
done
2020-05-03 18:47:39 +00:00
-@cp ./blogs/preamble/start.html ./blogs.html
2020-05-03 13:33:48 +00:00
./bin/GenBlog
@# Append the end of the file once done
-@for blog in ./blogs/RawBlogs/*.blog ; do \
blog=$$(echo $$blog | cut -c 17- | cut -d "." -f 1); \
cat ./blogs/preamble/end.html >> ./blogs/$$blog.html; \
done
2020-05-03 18:47:39 +00:00
-@cat ./blogs/preamble/end.html >> ./blogs.html