From 820d2f625d8eb606c129b6dc2df1b2e2180c4bc7 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Tue, 8 Nov 2016 19:21:12 -0500 Subject: [PATCH] added config.mk to allow for easy tweaking of build options --- Makefile | 16 ++++++---------- config.mk | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 config.mk diff --git a/Makefile b/Makefile index 71c69db..7ee3306 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,5 @@ -CC = c99 -LDFLAGS = -L/usr/X11/lib -lX11 -lXft -lfontconfig -CFLAGS = -Os $(INCS) -INCS = \ - -Iinc/ \ - -I/usr/X11/include \ - -I/usr/X11/include/freetype2 \ - -I/usr/include/freetype2 + +INCS = -Iinc/ LIBEDIT_OBJS = \ libedit/buf.o \ @@ -24,6 +18,8 @@ TEST_OBJS = \ tests/buf.o \ tests/utf8.o +include config.mk + all: xedit xpick test clean: @@ -36,9 +32,9 @@ xedit: xedit.o libx.a libedit.a xpick: xpick.o libx.a libedit.a libedit.a: $(LIBEDIT_OBJS) - $(AR) rcs $@ $^ + $(AR) $(ARFLAGS) $@ $^ libx.a: $(LIBX_OBJS) - $(AR) rcs $@ $^ + $(AR) $(ARFLAGS) $@ $^ unittests: $(TEST_OBJS) libedit.a diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..fc63cfe --- /dev/null +++ b/config.mk @@ -0,0 +1,21 @@ +# Customize this file to fit your system + +# Compiler Setup +CC = c99 +CFLAGS = -Os $(INCS) + +# Linker Setup +LD = $(CC) +LDFLAGS = $(LIBS) -lX11 -lXft -lfontconfig + +# Archive Setup +AR = ar +ARFLAGS = rcs + +# OSX X11 Flags +INCS += -I/usr/X11/include \ + -I/usr/X11/include/freetype2 +LIBS += -L/usr/X11/lib + +# Linux Freetype2 Flags +INCS += -I/usr/include/freetype2 -- 2.49.0