2022-06-29 06:56:32 +00:00
|
|
|
CFLAGS ?= -Wall -Wextra -g -O1
|
|
|
|
LDFLAGS ?= -g -O1
|
|
|
|
LIB_CFLAGS ?= -fpic
|
|
|
|
LIB_LDFLAGS ?= -shared
|
2022-06-30 07:30:34 +00:00
|
|
|
GARGOYLE_OBJS := delusion gargoyle scribe sleuth twine
|
2022-07-05 20:16:49 +00:00
|
|
|
GARGOYLE_TEST_OBJS := runner gargoyle scribe sleuth twine
|
2022-06-29 21:19:34 +00:00
|
|
|
#GARGOYLE_TEST_OBJS := runner $(GARGOYLE_OBJS)
|
2022-06-29 06:56:32 +00:00
|
|
|
|
2022-06-19 01:12:50 +00:00
|
|
|
.PHONY: all gargoyle init docs test clean
|
|
|
|
|
|
|
|
all: gargoyle
|
|
|
|
|
|
|
|
gargoyle: bin/libgargoyle.so
|
|
|
|
|
|
|
|
init: bin
|
|
|
|
|
|
|
|
bin:
|
2022-06-29 06:56:32 +00:00
|
|
|
mkdir -p -- bin/test
|
2022-06-19 01:12:50 +00:00
|
|
|
|
|
|
|
bin/libgargoyle.so: $(addprefix bin/,$(addsuffix .o,$(GARGOYLE_OBJS)))
|
2022-06-29 06:56:32 +00:00
|
|
|
cc $(LDFLAGS) $(LIB_LDFLAGS) -o $@ $^
|
2022-06-19 01:12:50 +00:00
|
|
|
|
|
|
|
bin/%.o: src/%.c | init
|
2022-06-29 06:56:32 +00:00
|
|
|
cc $(CFLAGS) $(LIB_CFLAGS) -std=c99 -I include -c -o $@ $<
|
2022-06-19 01:12:50 +00:00
|
|
|
|
|
|
|
docs:
|
|
|
|
@printf "not implemented yet.\n" >&2
|
|
|
|
|
2022-06-29 07:13:23 +00:00
|
|
|
test: bin/libgargoyle.so bin/gargoyle-test
|
|
|
|
bin/gargoyle-test
|
2022-06-29 06:56:32 +00:00
|
|
|
|
2022-06-29 07:13:23 +00:00
|
|
|
bin/gargoyle-test: $(addprefix bin/test/,$(addsuffix .o,$(GARGOYLE_TEST_OBJS)))
|
2022-07-03 03:42:03 +00:00
|
|
|
cc $(LDFLAGS) -L bin -o $@ $^ -l gargoyle -l cunit -l m
|
2022-06-29 06:56:32 +00:00
|
|
|
|
|
|
|
bin/test/%.o: test/%.c | init
|
|
|
|
cc $(CFLAGS) -std=c99 -I include -c -o $@ $<
|
2022-06-19 01:12:50 +00:00
|
|
|
|
|
|
|
clean:
|
2022-06-29 06:56:32 +00:00
|
|
|
rm -rf -- bin
|