Add shared library version

This commit is contained in:
pjht 2021-08-21 09:55:13 -05:00
parent e392e05c87
commit 724a31d3f4
2 changed files with 7 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
libzel.a libzel.a
libzel.so
*.o *.o
doc doc
tests/itest_arithmetic tests/itest_arithmetic

View File

@ -18,7 +18,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE. # THE SOFTWARE.
CPPFLAGS += -I. -Iinclude CPPFLAGS += -I. -Iinclude -fPIC
CFLAGS += -O3 CFLAGS += -O3
package := zel package := zel
@ -65,12 +65,15 @@ dist_source := z80.c \
.PHONY: all check clean distclean mostlyclean maintainer-clean dist distcheck doc-clean \ .PHONY: all check clean distclean mostlyclean maintainer-clean dist distcheck doc-clean \
install install-html install-pdf html pdf uninstall uninstall-doc install-doc installcheck install install-html install-pdf html pdf uninstall uninstall-doc install-doc installcheck
all: libzel.a all: libzel.a libzel.so
libzel.a: z80.o z80_instructions.o libzel.a: z80.o z80_instructions.o
$(AR) -cr $@ $? $(AR) -cr $@ $?
ranlib $@ ranlib $@
libzel.so: z80.o z80_instructions.o
gcc -shared -o $@ $?
tables/%.tab: tables/%.spec tables/gen.pl tables/%.tab: tables/%.spec tables/gen.pl
perl tables/gen.pl $< > $@ perl tables/gen.pl $< > $@
@ -137,6 +140,7 @@ man: doc
install: install:
$(INSTALL) -d $(DESTDIR)$(libdir) $(INSTALL) -d $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) libzel.a $(DESTDIR)$(libdir) $(INSTALL_PROGRAM) libzel.a $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) libzel.so $(DESTDIR)$(libdir)
$(INSTALL) -d $(DESTDIR)$(includedir)/zel $(INSTALL) -d $(DESTDIR)$(includedir)/zel
$(INSTALL_DATA) include/zel/z80.h $(DESTDIR)$(includedir)/zel $(INSTALL_DATA) include/zel/z80.h $(DESTDIR)$(includedir)/zel
$(INSTALL_DATA) include/zel/z80_instructions.h $(DESTDIR)$(includedir)/zel $(INSTALL_DATA) include/zel/z80_instructions.h $(DESTDIR)$(includedir)/zel