Skip to content

Instantly share code, notes, and snippets.

@guyhughes
Last active August 23, 2017 20:22
Show Gist options
  • Save guyhughes/04a691d6f1827e5fd92eafef5c340baf to your computer and use it in GitHub Desktop.
Save guyhughes/04a691d6f1827e5fd92eafef5c340baf to your computer and use it in GitHub Desktop.
NEOVIM MAKEFILE with gcc-7 (but default CC * CXX for deps)
# vim: set noet tabstop=5:
CC := gcc-7
CXX := g++-7
CPPFLAGS := -D_FORTIFY_SOURCE=2
LOCALMK_CMAKE_FLAGS = -DMIN_LOG_LEVEL=0 -DCMAKE_INSTALL_PREFIX=/usr/local
all:
setenv
.PHONY: gxgrel
gxgrel: CFLAGS := -O2 -fstack-protector-strong -pie -fPIE
gxgrel: LOCALMK_CMAKE_FLAGS += -DCMAKE_BUILD_TYPE=RelWithDebInfo
gxgrel: _gxgclean _gxgbuild _gxginstall
.PHONY: gxgdebug
gxgdebug: LOCALMK_CMAKE_FLAGS += -DCMAKE_BUILD_TYPE=Debug
gxgdebug: _gxgclean _gxgbuild _gxginstall
.PHONY: _gxgclean
_gxgclean: clean
rm -rf build
mkdir -p build
.PHONY: gxgdeps
gxgdeps: distclean
#export CC=$(CC) CXX=$(CC) CPPFLAGS=$(CPPFLAGS) &&
make deps
.PHONY: _gxgbuild
_gxgbuild: EXPORTS = export CC="$(CC)" CXX="$(CXX)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)"
_gxgbuild:
cd build && $(EXPORTS) && cmake .. $(LOCALMK_CMAKE_FLAGS)
.PHONY: _gxginstall
_gxginstall:
# make installs
make
.PHONY: gxgbrew
gxgbrew:
brew install libtool automake cmake pkg-config gettext ninja gcc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment