1 # Makefile - Build the PCF8833 display software 2 # 3 # Copyright (C) 2013 Paul Boddie 4 # 5 # This program is free software; you can redistribute it and/or modify 6 # it under the terms of the GNU General Public License as published by 7 # the Free Software Foundation; either version 2 of the License, or 8 # (at your option) any later version. 9 10 LIBUBB = ../ben-blinkenlights/libubb 11 SYSROOT = ../openwrt-xburst/staging_dir/target-mipsel_eglibc-2.15 12 TOOLBIN = ../openwrt-xburst/staging_dir/toolchain-mipsel_gcc-4.6-linaro_eglibc-2.15/bin 13 14 ARCH = mipsel-openwrt-linux 15 CC = $(TOOLBIN)/$(ARCH)-gcc 16 17 CFLAGS = -g -Wall -fPIC -march=mips32 -I$(LIBUBB)/include # -DDEBUG=1 18 LDFLAGS = -lm -lubb -L$(LIBUBB) 19 20 TARGETS = spin 21 22 BASICSRC = pcf8833.c 23 24 SOURCES = $(BASICSRC) spin.c 25 OBJECTS = $(SOURCES:.c=.o) 26 27 .PHONY: all clean distclean 28 29 all: $(TARGETS) 30 31 clean: 32 rm -f $(OBJECTS) $(TARGETS) 33 34 distclean: clean 35 echo "Nothing else to clean." 36 37 $(TARGETS): $(OBJECTS) 38 $(CC) $(LDFLAGS) $(OBJECTS) -o $@ 39 40 .c.o: 41 $(CC) -c $(CFLAGS) $< -o $@