create static link lib (thanks to Maximilian)

This commit is contained in:
oxygenic 2013-01-10 14:49:04 +01:00
parent 1d241cca05
commit 152c7d32af
3 changed files with 28 additions and 11 deletions

View file

@ -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

View file

@ -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;