I ended up running arudinoarduino-buider, available afterin Arduino IDE 1.6.6 and newer.
When laying out your project, put a libraries/ and hardware/ folder along side your sketch directory, like so:
YourHipProject/
Makefile
hardware/
Vendor/arch/{boards.txt,platform.txt}
libraries/
SomethingUseful/
NoIdeaHowThisWorks/
ProjectSketch/
ProjectSketch.ino
othersource.cpp
The hardware/ directory is only needed if you need support for 3rd party boards. Then, in the Makefile:
ARDUINO_DIR ?= /opt/arduino-1.6.13 # need to set this for your environment
.PHONY: ProjectSketch
ProjectSketch:
arduino-builder -compile -verbose \
-hardware $(ARDUINO_DIR)/hardware \
-tools $(ARDUINO_DIR)/tools-builder \
-tools $(ARDUINO_DIR)/hardware/tools/avr \
-built-in-libraries $(ARDUINO_DIR)/libraries \
-hardware ./hardware \
-libraries ./libraries \
-fqbn=Vendor:arch:board \
./ProjectSketch/ProjectSketch.ino
ARDUINO_DIR needs to point to where your Arduino is installed, be sure to set -fqbn= correctly too.
Running make should compile the firmware from ProjectSketch/ with the accompanying libraries and hardware definitions. Also, with verbose compile output enabled, the Arduino IDE will show you how it runs arduino-builder.