From 3e89adce77209ee3314a5ca4f536f653b9b261b3 Mon Sep 17 00:00:00 2001 From: Dane Johnson Date: Sun, 2 Jan 2022 19:01:01 -0600 Subject: [PATCH] Compile base to static library --- .gitignore | 1 + src/base/Makefile | 4 +++- src/cli/Makefile | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 8c854d1..5df0612 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.o +*.a storybook-cli src/cli/storybook-cli src/base/cyoa.cpp \ No newline at end of file diff --git a/src/base/Makefile b/src/base/Makefile index 3ba0032..d50ee96 100644 --- a/src/base/Makefile +++ b/src/base/Makefile @@ -1,7 +1,9 @@ CXXFLAGS = -g OBJS = cyoa.o storybook.o -all: $(OBJS) +all: libstorybook.a +libstorybook.a: $(OBJS) + ar rcs $@ $^ cyoa.cpp: cyoa.leg leg -o $@ $^ clean: diff --git a/src/cli/Makefile b/src/cli/Makefile index 2b64afc..41c5c4b 100644 --- a/src/cli/Makefile +++ b/src/cli/Makefile @@ -2,4 +2,4 @@ CXXFLAGS = -g -L../base/ .PHONY: all clean all: storybook-cli storybook-cli: storybook_cli.cpp - $(CXX) $(CXXFLAGS) -o $@ $^ ../base/storybook.o ../base/cyoa.o + $(CXX) $(CXXFLAGS) -o $@ $^ -lstorybook