summaryrefslogtreecommitdiff
path: root/misc/tools/fontsample/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'misc/tools/fontsample/Makefile')
-rw-r--r--misc/tools/fontsample/Makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/misc/tools/fontsample/Makefile b/misc/tools/fontsample/Makefile
new file mode 100644
index 000000000..063d7262d
--- /dev/null
+++ b/misc/tools/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