2008-07-14 09:15:55 +12:00
|
|
|
# Linux makefile for libzint
|
|
|
|
#
|
|
|
|
# make compiles with QR Code support
|
|
|
|
# make libzint_noqr compiles without QR Code support
|
|
|
|
# make install copies to /usr/local/lib
|
|
|
|
# make uninstall removes library
|
|
|
|
# make clean cleans up a previous compilation and any object or editor files
|
|
|
|
#
|
|
|
|
|
2009-09-30 00:15:16 +13:00
|
|
|
ZINT_VERSION:=-DZINT_VERSION=\"2.2.2\"
|
2008-09-19 02:39:25 +12:00
|
|
|
|
|
|
|
|
2008-07-14 09:15:55 +12:00
|
|
|
CC := gcc
|
|
|
|
INCLUDE := -I/usr/local/include
|
2008-09-03 07:43:02 +12:00
|
|
|
CFLAGS := -g
|
|
|
|
|
|
|
|
prefix := /usr/local
|
|
|
|
includedir := $(prefix)/include
|
|
|
|
libdir := $(prefix)/lib
|
|
|
|
DESTDIR :=
|
|
|
|
|
2009-09-29 22:45:46 +13:00
|
|
|
COMMON:= common.c png.c library.c ps.c large.c reedsol.c gs1.c svg.c shiftjis.c
|
|
|
|
COMMON_OBJ:= common.o png.o library.o ps.o large.o reedsol.o gs1.o svg.o shiftjis.o
|
2008-07-14 09:15:55 +12: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
|
2009-09-29 22:45:46 +13:00
|
|
|
TWODIM:= code16k.c blockf.c dmatrix.c dm200.c pdf417.c qr.c maxicode.c composite.c aztec.c micqr.c code49.c code1.c gridmtx.c
|
|
|
|
TWODIM_OBJ:= code16k.o blockf.o dmatrix.o dm200.o pdf417.o qr.o maxicode.o composite.o aztec.o micqr.o code49.o code1.o gridmtx.o
|
2008-07-14 09:15:55 +12:00
|
|
|
LIBS:= `libpng12-config --I_opts --L_opts --ldflags` -lz -lm
|
|
|
|
|
2008-09-19 02:39:25 +12:00
|
|
|
ifeq ($(NO_QR),true)
|
|
|
|
DEFINES:= -DNO_QR
|
2008-09-03 07:43:02 +12:00
|
|
|
else
|
2008-09-19 02:39:25 +12:00
|
|
|
DEFINES:=
|
2008-09-03 07:43:02 +12:00
|
|
|
LIBS+= -lqrencode
|
|
|
|
endif
|
|
|
|
|
2009-09-29 22:45:46 +13:00
|
|
|
libzint: code.c code128.c 2of5.c upcean.c medical.c telepen.c plessey.c postal.c auspost.c imail.c code16k.c dmatrix.c dm200.c reedsol.c pdf417.c maxicode.c rss.c common.c png.c library.c ps.c qr.c large.c composite.c aztec.c blockf.c micqr.c gs1.c svg.c code49.c code1.c gridmtx.c
|
2008-09-29 00:19:33 +13:00
|
|
|
$(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(ONEDIM)
|
|
|
|
$(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(POSTAL)
|
|
|
|
$(CC) -Wall -fPIC $(DEFINES) $(CFLAGS) $(ZINT_VERSION) -c $(TWODIM)
|
|
|
|
$(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(COMMON)
|
2009-08-06 20:36:01 +12:00
|
|
|
$(CC) $(CFLAGS) $(ZINT_VERSION) -shared -Wl,-soname,libzint.so -o libzint.so.2.2.1 $(INCLUDE) $(COMMON_OBJ) $(ONEDIM_OBJ) $(TWODIM_OBJ) $(POSTAL_OBJ) $(LIBS)
|
2008-09-03 07:43:02 +12:00
|
|
|
ln -s libzint.so.* libzint.so
|
2008-07-14 09:15:55 +12:00
|
|
|
|
|
|
|
.PHONY: install uninstall clean dist
|
|
|
|
|
|
|
|
install:
|
2008-09-03 07:43:02 +12:00
|
|
|
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
|
2008-07-14 09:15:55 +12:00
|
|
|
|
|
|
|
uninstall:
|
2009-03-02 21:52:13 +13:00
|
|
|
rm $(DESTDIR)$(libdir)/libzint.*
|
2008-09-03 07:43:02 +12:00
|
|
|
rm $(DESTDIR)$(includedir)/zint.h
|
2008-07-14 09:15:55 +12:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f libzint.* *.o *.a *~
|
|
|
|
|
|
|
|
|