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