2010-03-02 11:34:35 +13:00
|
|
|
# Linux makefile for libzint
|
|
|
|
#
|
|
|
|
# make compiles
|
|
|
|
# make install copies to /usr/local/lib
|
|
|
|
# make uninstall removes library
|
|
|
|
# make clean cleans up a previous compilation and any object or editor files
|
|
|
|
#
|
|
|
|
|
2013-01-01 02:41:42 +13:00
|
|
|
ZINT_VERSION:=-DZINT_VERSION=\"2.4.4\"
|
2010-03-02 11:34:35 +13:00
|
|
|
|
|
|
|
|
|
|
|
CC := gcc
|
2010-03-04 20:38:47 +13:00
|
|
|
INCLUDE := -I/usr/include
|
2010-03-02 11:34:35 +13:00
|
|
|
CFLAGS := -g
|
|
|
|
|
2010-03-04 20:38:47 +13:00
|
|
|
prefix := /usr
|
2010-03-02 11:34:35 +13:00
|
|
|
includedir := $(prefix)/include
|
|
|
|
libdir := $(prefix)/lib
|
|
|
|
DESTDIR :=
|
|
|
|
|
2010-05-31 05:25:24 +12:00
|
|
|
COMMON:= common.c render.c png.c library.c ps.c large.c reedsol.c gs1.c svg.c
|
|
|
|
COMMON_OBJ:= common.o render.o png.o library.o ps.o large.o reedsol.o gs1.o svg.o
|
2010-03-02 11:34:35 +13:00
|
|
|
ONEDIM:= code.c code128.c 2of5.c upcean.c telepen.c medical.c plessey.c rss.c
|
|
|
|
ONEDIM_OBJ:= code.o code128.o 2of5.o upcean.o telepen.o medical.o plessey.o rss.o
|
|
|
|
POSTAL:= postal.c auspost.c imail.c
|
|
|
|
POSTAL_OBJ:= postal.o auspost.o imail.o
|
2011-03-22 01:02:28 +13:00
|
|
|
TWODIM:= code16k.c dmatrix.c pdf417.c qr.c maxicode.c composite.c aztec.c code49.c code1.c gridmtx.c
|
2011-05-02 18:24:09 +12:00
|
|
|
TWODIM_OBJ:= code16k.o dmatrix.o pdf417.o qr.o maxicode.o composite.o aztec.o code49.o code1.o gridmtx.o
|
2013-01-11 02:49:04 +13:00
|
|
|
OBJS:=$(COMMON_OBJ) $(ONEDIM_OBJ) $(TWODIM_OBJ) $(POSTAL_OBJ)
|
2012-12-30 07:37:03 +13:00
|
|
|
LIBS:= -lz -lm -lpng
|
2013-01-11 02:49:04 +13:00
|
|
|
|
|
|
|
all: libzint.a libzint.so
|
|
|
|
|
|
|
|
libzint.a: $(OBJS)
|
|
|
|
$(AR) rcs libzint.a $(OBJS)
|
2010-03-02 11:34:35 +13:00
|
|
|
|
2013-01-11 02:49:04 +13:00
|
|
|
libzint.so.2.4.4: $(OBJS)
|
|
|
|
$(CC) $(CFLAGS) $(ZINT_VERSION) -shared -Wl,-soname,libzint.so -o libzint.so.2.4.4 $(INCLUDE) $(OBJS) $(LIBS)
|
|
|
|
|
|
|
|
libzint.so: libzint.so.2.4.4
|
|
|
|
rm -f libzint.so
|
2010-03-02 11:34:35 +13:00
|
|
|
ln -s libzint.so.* libzint.so
|
|
|
|
|
2013-01-11 02:49:04 +13:00
|
|
|
%.o: %.c
|
|
|
|
$(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c -o $@ $<
|
|
|
|
|
2010-03-02 11:34:35 +13:00
|
|
|
.PHONY: install uninstall clean dist
|
|
|
|
|
|
|
|
install:
|
|
|
|
test "$(UID)" = "0" && ldconfig -n $(PWD) || true
|
|
|
|
install -d $(DESTDIR)$(libdir)
|
|
|
|
mv libzint.* $(DESTDIR)$(libdir)
|
|
|
|
install -D -p --mode=0644 zint.h $(DESTDIR)$(includedir)/zint.h
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm $(DESTDIR)$(libdir)/libzint.*
|
|
|
|
rm $(DESTDIR)$(includedir)/zint.h
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f libzint.* *.o *.a *~
|
|
|
|
|
|
|
|
|