|
|
@ -51,16 +51,19 @@ CFLAGS ?= -std=c99 -O
|
|
|
|
# ---- Targets to build ----
|
|
|
|
# ---- Targets to build ----
|
|
|
|
|
|
|
|
|
|
|
|
LIB = qrcodegen
|
|
|
|
LIB = qrcodegen
|
|
|
|
LIBFILE = lib$(LIB).a
|
|
|
|
ARFILE = lib$(LIB).a
|
|
|
|
|
|
|
|
LIBFILE = lib$(LIB).so
|
|
|
|
|
|
|
|
# Bump the soname number when the ABI changes and gets incompatible
|
|
|
|
|
|
|
|
SO_NAME = $(LIBFILE).1
|
|
|
|
LIBOBJ = qrcodegen.o
|
|
|
|
LIBOBJ = qrcodegen.o
|
|
|
|
MAINS = qrcodegen-demo qrcodegen-test qrcodegen-worker
|
|
|
|
MAINS = qrcodegen-demo qrcodegen-test qrcodegen-worker
|
|
|
|
|
|
|
|
|
|
|
|
# Build all binaries
|
|
|
|
# Build all binaries
|
|
|
|
all: $(LIBFILE) $(MAINS)
|
|
|
|
all: $(LIBFILE) $(ARFILE) $(MAINS)
|
|
|
|
|
|
|
|
|
|
|
|
# Delete build output
|
|
|
|
# Delete build output
|
|
|
|
clean:
|
|
|
|
clean:
|
|
|
|
rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
|
|
|
|
rm -f -- $(LIBOBJ) $(LIBFILE) $(ARFILE) $(MAINS:=.o) $(MAINS)
|
|
|
|
rm -rf .deps
|
|
|
|
rm -rf .deps
|
|
|
|
|
|
|
|
|
|
|
|
# Executable files
|
|
|
|
# Executable files
|
|
|
@ -72,9 +75,12 @@ qrcodegen-test: qrcodegen-test.c $(LIBOBJ:%.o=%.c)
|
|
|
|
$(CC) $(CFLAGS) -DQRCODEGEN_TEST -o $@ $^
|
|
|
|
$(CC) $(CFLAGS) -DQRCODEGEN_TEST -o $@ $^
|
|
|
|
|
|
|
|
|
|
|
|
# The library
|
|
|
|
# The library
|
|
|
|
$(LIBFILE): $(LIBOBJ)
|
|
|
|
$(ARFILE): $(LIBOBJ)
|
|
|
|
$(AR) -crs $@ -- $^
|
|
|
|
$(AR) -crs $@ -- $^
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(LIBFILE): $(LIBOBJ)
|
|
|
|
|
|
|
|
$(CC) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
|
|
|
|
# Object files
|
|
|
|
# Object files
|
|
|
|
%.o: %.c .deps/timestamp
|
|
|
|
%.o: %.c .deps/timestamp
|
|
|
|
$(CC) $(CFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
|
|
|
|
$(CC) $(CFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
|
|
|
|