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@1 | 20 | SPIN = spin |
paul@1 | 21 | BITMAP = bitmap |
paul@1 | 22 | TARGETS = $(SPIN) $(BITMAP) |
paul@0 | 23 | |
paul@0 | 24 | BASICSRC = pcf8833.c |
paul@0 | 25 | |
paul@1 | 26 | SPINSOURCES = $(BASICSRC) spin.c |
paul@1 | 27 | SPINOBJECTS = $(SPINSOURCES:.c=.o) |
paul@1 | 28 | |
paul@1 | 29 | BITMAPSOURCES = $(BASICSRC) bitmap.c bitmaps.c |
paul@1 | 30 | BITMAPOBJECTS = $(BITMAPSOURCES:.c=.o) |
paul@1 | 31 | |
paul@1 | 32 | ALLSOURCES = $(BASICSRC) spin.c bitmap.c bitmaps.c |
paul@1 | 33 | ALLOBJECTS = $(ALLSOURCES:.c=.o) |
paul@1 | 34 | |
paul@1 | 35 | IMAGES = examples/*.JPG |
paul@1 | 36 | IMAGESOURCES = bitmaps.c bitmaps.h |
paul@0 | 37 | |
paul@0 | 38 | .PHONY: all clean distclean |
paul@0 | 39 | |
paul@0 | 40 | all: $(TARGETS) |
paul@0 | 41 | |
paul@0 | 42 | clean: |
paul@1 | 43 | rm -f $(ALLOBJECTS) $(IMAGESOURCES) $(TARGETS) |
paul@0 | 44 | |
paul@0 | 45 | distclean: clean |
paul@0 | 46 | echo "Nothing else to clean." |
paul@0 | 47 | |
paul@1 | 48 | $(SPIN): $(SPINOBJECTS) |
paul@1 | 49 | $(CC) $(LDFLAGS) $(SPINOBJECTS) -o $@ |
paul@1 | 50 | |
paul@1 | 51 | $(BITMAP): $(BITMAPOBJECTS) |
paul@1 | 52 | $(CC) $(LDFLAGS) $(BITMAPOBJECTS) -o $@ |
paul@1 | 53 | |
paul@1 | 54 | bitmap.c: $(IMAGESOURCES) |
paul@1 | 55 | |
paul@1 | 56 | $(IMAGESOURCES): $(IMAGES) |
paul@1 | 57 | tools/bitmap.py bitmaps $(IMAGES) |
paul@0 | 58 | |
paul@0 | 59 | .c.o: |
paul@0 | 60 | $(CC) -c $(CFLAGS) $< -o $@ |