summaryrefslogtreecommitdiff
path: root/misc/fontsample/Makefile
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2018-09-01 22:57:55 +0300
committerRasmus Andersson <rasmus@notion.se>2018-09-01 22:57:55 +0300
commit50ca3807f77eec9c01dcb5107da9348026e83c6c (patch)
treebea7efdc32c42aa9565437d91781b1397c9310ba /misc/fontsample/Makefile
parent4e6c626ab32fdc7806e748537c589978b6ddbcfc (diff)
downloadinter-50ca3807f77eec9c01dcb5107da9348026e83c6c.tar.xz
Adds fontsample tool for rendering PDF and PNG font samples on macOS
Diffstat (limited to 'misc/fontsample/Makefile')
-rw-r--r--misc/fontsample/Makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/misc/fontsample/Makefile b/misc/fontsample/Makefile
new file mode 100644
index 000000000..063d7262d
--- /dev/null
+++ b/misc/fontsample/Makefile
@@ -0,0 +1,44 @@
+sources = fontsample.mm
+
+CC = clang
+CXX = clang
+LD = clang
+
+XFLAGS := -Wall -g -fno-common
+CFLAGS += -std=c11
+CXXFLAGS += -std=c++11 -stdlib=libc++ -fno-rtti -fno-exceptions
+LDFLAGS += -lc++
+
+#flags release and debug targets (e.g. make DEBUG=1)
+ifeq ($(strip $(DEBUG)),1)
+ XFLAGS += -O0
+# else
+# XFLAGS += -Os -DNDEBUG
+endif
+
+libs := -lobjc
+frameworks := -framework Foundation \
+ -framework CoreText \
+ -framework CoreServices \
+ -framework CoreGraphics \
+ -framework ImageIO
+
+c_flags = $(CFLAGS) $(XFLAGS) -MMD -fobjc-arc
+cxx_flags = $(CXXFLAGS) $(XFLAGS) -MMD -fobjc-arc
+ld_flags = $(LDFLAGS) $(libs) $(frameworks)
+
+objects := $(sources:%.c=%.o)
+objects := $(objects:%.cc=%.o)
+objects := $(objects:%.mm=%.o)
+
+fontsample: $(objects)
+ $(LD) $(ld_flags) -o $@ $^
+
+%.o: %.mm
+ $(CXX) $(cxx_flags) -c $<
+
+clean:
+ rm -f *.o
+
+all: fontsample
+.PHONY: all clean