From 2fe897e2cf750339a7e466aeafe64f45fb650f10 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 5 Nov 2020 15:50:11 -0500 Subject: Initial commit --- Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..61957d7 --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +CC=g++ +LIBS=sword +CFLAGS=-c -Wall -fPIC +LDFLAGS= +SOURCES=libbible.cc mods.cc settings.cc +OBJECTS=$(SOURCES:.cc=.o) +LIBRARY=libbible.so +ifeq ($(PREFIX),) + PREFIX := /usr +endif + +all: $(SOURCES) $(LIBRARY) + +install: $(LIBRARY) + install -d $(DESTDIR)$(PREFIX)/lib/ + install -m 644 $(LIBRARY) $(DESTDIR)$(PREFIX)/lib/ + install -d $(DESTDIR)$(PREFIX)/include/ + install -m 644 libbible.h $(DESTDIR)$(PREFIX)/include/ + +test: $(OBJECTS) testLibbible.o + $(CC) $(LDFLAGS) $(OBJECTS) testLibbible.o -o $@ `pkg-config $(LIBS) --libs` -lcppunit + +testLibbible.o: testLibbible.cc + $(CC) $(CFLAGS) testLibbible.cc -o $@ + +bible: $(OBJECTS) bible.o + $(CC) $(LDFLAGS) $(OBJECTS) bible.o -o $@ `pkg-config $(LIBS) --libs` + +bible.o: bible.cc + $(CC) $(CFLAGS) bible.cc -o $@ + +$(LIBRARY): $(OBJECTS) + $(CC) $(LDFLAGS) $(OBJECTS) -shared -o $@ `pkg-config $(LIBS) --libs` + +.cc.o: + $(CC) $(CFLAGS) $< -o $@ `pkg-config $(LIBS) --cflags` + +clean: + rm -rf *.o $(LIBRARY) test bible -- cgit v1.2.3