aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 906d19d..f772350 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,10 @@ objfiles = $(objs:%=build/%.o)
TEST_1_NAME = t/test_1$(BIN_POSTFIX)
TEST_2_NAME = t/test_2$(BIN_POSTFIX)
+examples=hello variable
+example_bins=$(examples:%=examples/%$(BIN_POSTFIX))
+example_objs=$(examples:%=examples/%.o)
+
$(LIBNAME): $(objfiles)
ar rc $@ $^
ranlib $@
@@ -36,6 +40,14 @@ test: $(TEST_1_NAME) $(TEST_2_NAME)
#$(TEST_1_NAME)
$(TEST_2_NAME)
+examples: $(example_bins)
+ $(example_bins)
+$(example_bins): %$(BIN_POSTFIX) : %.o
+ $(CC) $(CFLAGS) -o $@ $< -lctemplates
+
+$(example_objs): %.o : %.c
+ $(CC) -I./include -L. -c -o $@ $< -lctemplates
+
install: $(LIBNAME)
cp $(LIBNAME) /usr/local/lib
mkdir -p /usr/local/include/ctemplates