diff --git a/backend/Makefile b/backend/Makefile index d94c23af..53d147e0 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -26,16 +26,24 @@ POSTAL:= postal.c auspost.c imail.c POSTAL_OBJ:= postal.o auspost.o imail.o TWODIM:= code16k.c dmatrix.c pdf417.c qr.c maxicode.c composite.c aztec.c code49.c code1.c gridmtx.c TWODIM_OBJ:= code16k.o dmatrix.o pdf417.o qr.o maxicode.o composite.o aztec.o code49.o code1.o gridmtx.o +OBJS:=$(COMMON_OBJ) $(ONEDIM_OBJ) $(TWODIM_OBJ) $(POSTAL_OBJ) LIBS:= -lz -lm -lpng + +all: libzint.a libzint.so + +libzint.a: $(OBJS) + $(AR) rcs libzint.a $(OBJS) -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 reedsol.c pdf417.c maxicode.c rss.c common.c render.c png.c library.c ps.c qr.c large.c composite.c aztec.c gs1.c svg.c code49.c code1.c gridmtx.c - $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(ONEDIM) - $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(POSTAL) - $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(TWODIM) - $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c $(COMMON) - $(CC) $(CFLAGS) $(ZINT_VERSION) -shared -Wl,-soname,libzint.so -o libzint.so.2.3.2 $(INCLUDE) $(COMMON_OBJ) $(ONEDIM_OBJ) $(TWODIM_OBJ) $(POSTAL_OBJ) $(LIBS) +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 ln -s libzint.so.* libzint.so +%.o: %.c + $(CC) -Wall -fPIC $(CFLAGS) $(ZINT_VERSION) -c -o $@ $< + .PHONY: install uninstall clean dist install: diff --git a/frontend/Makefile b/frontend/Makefile index f3e6fc69..05b11673 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -15,14 +15,23 @@ CFLAGS := -g prefix := /usr bindir := $(prefix)/bin DESTDIR := +LIBS:= -lz -lm -lpng -zint: main.c - $(CC) -Wall $(INCLUDE) $(CFLAGS) $(ZINT_VERSION) -I../backend -L../backend main.c -o zint -lzint +all: zint zint-static + +main.o: main.c + $(CC) -c -Wall $(INCLUDE) $(CFLAGS) $(ZINT_VERSION) -I../backend main.c -o main.o + +zint: main.o + $(CC) -Wall $(INCLUDE) $(CFLAGS) $(ZINT_VERSION) -I../backend -L../backend main.o -o zint -lzint + +zint-static: main.c + $(CC) -Wall $(INCLUDE) $(CFLAGS) $(ZINT_VERSION) -I../backend main.o -o zint-static ../backend/libzint.a $(LIBS) .PHONY: install uninstall clean dist clean: - rm -f zint *.o *.a *~ *.png *.eps *.svg *.log + rm -f zint zint-static *.o *.a *~ *.png *.eps *.svg *.log install: install -D -p zint $(DESTDIR)$(bindir)/zint diff --git a/frontend/main.c b/frontend/main.c index bccf3caf..c23399a6 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -168,7 +168,7 @@ int escape_char_process(struct zint_symbol *my_symbol, unsigned char input_strin return error_number; } -char itoc(int source) +static char itoc(int source) { /* Converts an integer value to its hexadecimal character */ if ((source >= 0) && (source <= 9)) { return ('0' + source); } @@ -176,7 +176,7 @@ char itoc(int source) return ('A' + (source - 10)); } } -void concat(char dest[], char source[]) +static void concat(char dest[], char source[]) { /* Concatinates dest[] with the contents of source[], copying /0 as well */ unsigned int i, j, n;