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