2 # Makefile for QR Code generator (C++)
4 # Copyright (c) Project Nayuki. (MIT License)
5 # https://www.nayuki.io/page/qr-code-generator-library
7 # Permission is hereby granted, free of charge, to any person obtaining a copy of
8 # this software and associated documentation files (the "Software"), to deal in
9 # the Software without restriction, including without limitation the rights to
10 # use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 # the Software, and to permit persons to whom the Software is furnished to do so,
12 # subject to the following conditions:
13 # - The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
15 # - The Software is provided "as is", without warranty of any kind, express or
16 # implied, including but not limited to the warranties of merchantability,
17 # fitness for a particular purpose and noninfringement. In no event shall the
18 # authors or copyright holders be liable for any claim, damages or other
19 # liability, whether in an action of contract, tort or otherwise, arising from,
20 # out of or in connection with the Software or the use or other dealings in the
25 # ---- Configuration options ----
27 # External/implicit variables:
28 # - CXX: The C++ compiler, such as g++ or clang++.
29 # - CXXFLAGS: Any extra user-specified compiler flags (can be blank).
31 # Recommended compiler flags:
32 CXXFLAGS += -std=c++11 -O
34 # Extra flags for diagnostics:
35 # CXXFLAGS += -g -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -fsanitize=undefined,address
38 # ---- Controlling make ----
40 # Clear default suffix rules
43 # Don't delete object files
46 # Stuff concerning goals
51 # ---- Targets to build ----
56 MAINS = QrCodeGeneratorDemo QrCodeGeneratorWorker
59 all: $(LIBFILE) $(MAINS)
63 rm -f -- $(LIBOBJ) $(LIBFILE) $(MAINS:=.o) $(MAINS)
68 $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $< -L . -l $(LIB)
75 %.o: %.cpp .deps/timestamp
76 $(CXX) $(CXXFLAGS) -c -o $@ -MMD -MF .deps/$*.d $<
78 # Have a place to store header dependencies automatically generated by compiler
83 # Make use of said dependencies if available