2020-05-03 13:33:48 +00:00
|
|
|
# Makefile for blog
|
|
|
|
|
|
|
|
CC=gcc
|
|
|
|
FLAGS=-Wall -pedantic
|
|
|
|
EXE=bin/GenBlog
|
|
|
|
|
|
|
|
all: install
|
|
|
|
$(CC) $(FLAGS) src/GenBlog.c -o $(EXE)
|
|
|
|
|
2020-05-03 15:26:21 +00:00
|
|
|
debug: install
|
|
|
|
$(CC) $(FLAGS) -DDEBUG src/GenBlog.c -o $(EXE)
|
|
|
|
|
2020-05-03 13:33:48 +00:00
|
|
|
install:
|
|
|
|
mkdir -p bin
|
|
|
|
mkdir -p obj
|
2020-05-03 15:26:21 +00:00
|
|
|
mkdir -p blogs
|
2020-05-03 13:33:48 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf obj
|
|
|
|
rm -rf bin
|
|
|
|
|
|
|
|
blog: all
|
2020-05-03 15:26:21 +00:00
|
|
|
@# Reset all blogs to start build.
|
|
|
|
-rm -rf blogs/*.html
|
|
|
|
@# 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 13:33:48 +00:00
|
|
|
./bin/GenBlog
|
2020-05-03 15:26:21 +00:00
|
|
|
@# 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
|