Root/
| 1 | # |
| 2 | # libubb/Makefile - Build the UBB library |
| 3 | # |
| 4 | # Written 2012-2013 by Werner Almesberger |
| 5 | # Copyright 2012-2013 Werner Almesberger |
| 6 | # |
| 7 | # This program is free software; you can redistribute it and/or modify |
| 8 | # it under the terms of the GNU General Public License as published by |
| 9 | # the Free Software Foundation; either version 2 of the License, or |
| 10 | # (at your option) any later version. |
| 11 | # |
| 12 | |
| 13 | |
| 14 | TARGET = mipsel-openwrt-linux- |
| 15 | CC = $(TARGET)gcc |
| 16 | LD = $(TARGET)ld |
| 17 | |
| 18 | CFLAGS = -g -Wall -fPIC -march=mips32 -Iinclude |
| 19 | LIB = libubb.a |
| 20 | SHLIB = libubb.so |
| 21 | |
| 22 | OBJS = ubb.o swuart.o mmcclk.o physmem.o |
| 23 | HDRS = ubb/ubb.h ubb/regbase.h ubb/regs4740.h ubb/swuart.h ubb/mmcclk.h \ |
| 24 | ubb/physmem.h |
| 25 | |
| 26 | .PHONY: all clean spotless |
| 27 | |
| 28 | all: $(SHLIB) |
| 29 | |
| 30 | $(SHLIB): $(LIB) |
| 31 | $(LD) -shared -soname $@ -o $@ \ |
| 32 | --whole-archive $^ || { rm -f $@; exit 1; } |
| 33 | |
| 34 | $(LIB): $(OBJS) |
| 35 | $(AR) cr $@ $^ || { rm -f $@; exit 1; } |
| 36 | |
| 37 | clean: |
| 38 | rm -f $(OBJS) |
| 39 | |
| 40 | spotless: clean |
| 41 | rm -f $(LIB) $(SHLIB) |
| 42 |
Branches:
master
