paul@0 | 1 | # Makefile - Build the UBB library |
paul@0 | 2 | # |
paul@0 | 3 | # Copyright 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 | SYSLIBS = ../openwrt-xburst/staging_dir/target-mipsel_eglibc-2.15/usr/lib |
paul@0 | 12 | |
paul@0 | 13 | ARCH = mipsel-openwrt-linux |
paul@0 | 14 | CC = $(ARCH)-gcc |
paul@0 | 15 | |
paul@28 | 16 | CFLAGS = -g -Wall -fPIC -march=mips32 -I$(LIBUBB)/include # -DDEBUG_EVENTS=1 # -DDEBUG=1 |
paul@0 | 17 | LDFLAGS = -lubb -L$(LIBUBB) #-static #-L$(SYSLIBS) |
paul@0 | 18 | |
paul@0 | 19 | TARGET = test |
paul@0 | 20 | SRC = test.c |
paul@0 | 21 | OBJ = $(SRC:.c=.o) |
paul@0 | 22 | |
paul@0 | 23 | .PHONY: all clean distclean |
paul@0 | 24 | |
paul@0 | 25 | all: $(TARGET) |
paul@0 | 26 | |
paul@0 | 27 | clean: |
paul@0 | 28 | rm -f $(OBJ) $(TARGET) |
paul@0 | 29 | |
paul@0 | 30 | distclean: clean |
paul@0 | 31 | echo "Nothing else to clean." |
paul@0 | 32 | |
paul@0 | 33 | $(TARGET): $(OBJ) |
paul@0 | 34 | $(CC) $(LDFLAGS) $< -o $@ |
paul@0 | 35 | |
paul@0 | 36 | .c.o: |
paul@0 | 37 | $(CC) -c $(CFLAGS) $< -o $@ |