forked from ports/contrib
144 lines
4.4 KiB
Diff
144 lines
4.4 KiB
Diff
diff -up QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/c/Makefile.1~ QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/c/Makefile
|
|
--- QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/c/Makefile.1~ 2020-01-29 18:52:21.000000000 +0100
|
|
+++ QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/c/Makefile 2020-03-02 05:14:45.909539003 +0100
|
|
@@ -29,11 +29,13 @@
|
|
# - CFLAGS: Any extra user-specified compiler flags (can be blank).
|
|
|
|
# Recommended compiler flags:
|
|
-CFLAGS += -std=c99 -O
|
|
+CFLAGS += -std=c99
|
|
|
|
# Extra flags for diagnostics:
|
|
# CFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
|
|
|
|
+# Version information
|
|
+VERSION = 1.5.0
|
|
|
|
# ---- Controlling make ----
|
|
|
|
@@ -51,10 +53,18 @@ CFLAGS += -std=c99 -O
|
|
# ---- Targets to build ----
|
|
|
|
LIB = qrcodegen
|
|
-LIBFILE = lib$(LIB).a
|
|
+LIBFILE = lib$(LIB).so
|
|
+# Bump the soname number when the ABI changes and gets incompatible
|
|
+SO_NAME = $(LIBFILE).1
|
|
+REAL_NAME = $(LIBFILE).$(VERSION)
|
|
+HEADERS = qrcodegen.h
|
|
LIBOBJ = qrcodegen.o
|
|
MAINS = qrcodegen-demo qrcodegen-test qrcodegen-worker
|
|
|
|
+# define paths to install
|
|
+INCLUDEDIR ?= $(DESTDIR)/usr/include/qrcodegen
|
|
+LIBDIR ?= $(DESTDIR)/usr/lib
|
|
+
|
|
# Build all binaries
|
|
all: $(LIBFILE) $(MAINS)
|
|
|
|
@@ -63,6 +73,18 @@ clean:
|
|
rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
|
|
rm -rf .deps
|
|
|
|
+install-shared: $(LIBFILE)
|
|
+ install -d $(LIBDIR) || true
|
|
+ install -m 0755 $(LIBFILE) $(LIBDIR)/$(REAL_NAME)
|
|
+ ln -s $(REAL_NAME) $(LIBDIR)/$(SO_NAME)
|
|
+ ln -s $(SO_NAME) $(LIBDIR)/$(LIBFILE)
|
|
+
|
|
+install-header: $(HEADERS)
|
|
+ install -d $(INCLUDEDIR) || true
|
|
+ install -m 0644 $(HEADERS) $(INCLUDEDIR)/
|
|
+
|
|
+install: install-shared install-header
|
|
+
|
|
# Executable files
|
|
%: %.o $(LIBFILE)
|
|
$(CC) $(CFLAGS) -o $@ $< -L . -l $(LIB)
|
|
@@ -73,11 +95,11 @@ qrcodegen-test: qrcodegen-test.c $(LIBOB
|
|
|
|
# The library
|
|
$(LIBFILE): $(LIBOBJ)
|
|
- $(AR) -crs $@ -- $^
|
|
+ $(CC) $(CXXFLAGS) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^
|
|
|
|
# Object files
|
|
%.o: %.c .deps/timestamp
|
|
- $(CC) $(CFLAGS) -c -o $@ -MMD -MF .deps/$*.d $<
|
|
+ $(CC) $(CFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
|
|
|
|
# Have a place to store header dependencies automatically generated by compiler
|
|
.deps/timestamp:
|
|
diff -up QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/cpp/Makefile.1~ QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/cpp/Makefile
|
|
--- QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/cpp/Makefile.1~ 2020-01-29 18:52:21.000000000 +0100
|
|
+++ QR-Code-generator-13a25580a3e2a29b2b6653802d58d39056f3eaf2/cpp/Makefile 2020-03-02 05:15:35.901541207 +0100
|
|
@@ -29,11 +29,13 @@
|
|
# - CXXFLAGS: Any extra user-specified compiler flags (can be blank).
|
|
|
|
# Recommended compiler flags:
|
|
-CXXFLAGS += -std=c++11 -O
|
|
+CXXFLAGS += -std=c++11
|
|
|
|
# Extra flags for diagnostics:
|
|
# CXXFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
|
|
|
|
+# Version information
|
|
+VERSION = 1.5.0
|
|
|
|
# ---- Controlling make ----
|
|
|
|
@@ -50,11 +52,19 @@ CXXFLAGS += -std=c++11 -O
|
|
|
|
# ---- Targets to build ----
|
|
|
|
-LIB = qrcodegen
|
|
-LIBFILE = lib$(LIB).a
|
|
+LIB = qrcodegencpp
|
|
+LIBFILE = lib$(LIB).so
|
|
+# Bump the soname number when the ABI changes and gets incompatible
|
|
+SO_NAME = $(LIBFILE).1
|
|
+REAL_NAME = $(LIBFILE).$(VERSION)
|
|
+HEADERS = QrCode.hpp
|
|
LIBOBJ = QrCode.o
|
|
MAINS = QrCodeGeneratorDemo QrCodeGeneratorWorker
|
|
|
|
+# define paths to install
|
|
+INCLUDEDIR ?= $(DESTDIR)/usr/include/qrcodegen
|
|
+LIBDIR ?= $(DESTDIR)/usr/lib
|
|
+
|
|
# Build all binaries
|
|
all: $(LIBFILE) $(MAINS)
|
|
|
|
@@ -63,17 +73,29 @@ clean:
|
|
rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
|
|
rm -rf .deps
|
|
|
|
+install-shared: $(LIBFILE)
|
|
+ install -d $(LIBDIR) || true
|
|
+ install -m 0755 $(LIBFILE) $(LIBDIR)/$(REAL_NAME)
|
|
+ ln -s $(REAL_NAME) $(LIBDIR)/$(SO_NAME)
|
|
+ ln -s $(SO_NAME) $(LIBDIR)/$(LIBFILE)
|
|
+
|
|
+install-header: $(HEADERS)
|
|
+ install -d $(INCLUDEDIR) || true
|
|
+ install -m 0644 $(HEADERS) $(INCLUDEDIR)/
|
|
+
|
|
+install: install-shared install-header
|
|
+
|
|
# Executable files
|
|
%: %.o $(LIBFILE)
|
|
$(CXX) $(CXXFLAGS) -o $@ $< -L . -l $(LIB)
|
|
|
|
# The library
|
|
$(LIBFILE): $(LIBOBJ)
|
|
- $(AR) -crs $@ -- $^
|
|
+ $(CXX) $(CXXFLAGS) -shared -Wl,-soname,$(SO_NAME) $(LDFLAGS) -o $@ $^
|
|
|
|
# Object files
|
|
%.o: %.cpp .deps/timestamp
|
|
- $(CXX) $(CXXFLAGS) -c -o $@ -MMD -MF .deps/$*.d $<
|
|
+ $(CXX) $(CXXFLAGS) -fPIC -c -o $@ -MMD -MF .deps/$*.d $<
|
|
|
|
# Have a place to store header dependencies automatically generated by compiler
|
|
.deps/timestamp:
|