Configure the build system

This commit is contained in:
Nick Chambers 2022-06-18 20:12:50 -05:00
parent 9eae2d01b2
commit 4bad91fd37
2 changed files with 32 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/bin/
/tmp/
.DS_Store

29
Makefile Normal file
View File

@ -0,0 +1,29 @@
CFLAGS ?= -Wall -Wextra -g -O1 -fpic
LDFLAGS ?= -g -O1 -shared
GARGOYLE_OBJS := gargoyle
.PHONY: all gargoyle init docs test clean
all: gargoyle
gargoyle: bin/libgargoyle.so
init: bin
bin:
mkdir -p -- bin
bin/libgargoyle.so: $(addprefix bin/,$(addsuffix .o,$(GARGOYLE_OBJS)))
cc $(LDFLAGS) -o $@ $^
bin/%.o: src/%.c | init
cc $(CFLAGS) -std=c99 -I include -c -o $@ $<
docs:
@printf "not implemented yet.\n" >&2
test:
@printf "not implemented yet.\n" >&2
clean:
rm -rf -- bin/*