2012-12-17 05:44:48 +02:00
|
|
|
#
|
|
|
|
# libubb/Makefile - Build the UBB library
|
|
|
|
#
|
2013-01-07 13:21:00 +02:00
|
|
|
# Written 2012-2013 by Werner Almesberger
|
|
|
|
# Copyright 2012-2013 Werner Almesberger
|
2012-12-17 05:44:48 +02:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
TARGET = mipsel-openwrt-linux-
|
|
|
|
CC = $(TARGET)gcc
|
2013-01-07 13:21:00 +02:00
|
|
|
LD = $(TARGET)ld
|
2012-12-17 05:44:48 +02:00
|
|
|
|
2013-01-16 04:30:02 +02:00
|
|
|
CFLAGS = -g -Wall -fPIC -march=mips32 -Iinclude
|
2012-12-17 05:44:48 +02:00
|
|
|
LIB = libubb.a
|
2013-01-07 13:21:00 +02:00
|
|
|
SHLIB = libubb.so
|
2012-12-17 05:44:48 +02:00
|
|
|
|
2013-01-14 08:54:17 +02:00
|
|
|
OBJS = ubb.o swuart.o mmcclk.o physmem.o
|
|
|
|
HDRS = ubb/ubb.h ubb/regbase.h ubb/regs4740.h ubb/swuart.h ubb/mmcclk.h \
|
|
|
|
ubb/physmem.h
|
2012-12-17 05:44:48 +02:00
|
|
|
|
|
|
|
.PHONY: all clean spotless
|
|
|
|
|
2013-01-07 16:47:53 +02:00
|
|
|
all: $(SHLIB)
|
2013-01-07 13:21:00 +02:00
|
|
|
|
|
|
|
$(SHLIB): $(LIB)
|
2013-01-07 21:28:59 +02:00
|
|
|
$(LD) -shared -soname $@ -o $@ \
|
2013-01-07 13:21:00 +02:00
|
|
|
--whole-archive $^ || { rm -f $@; exit 1; }
|
2012-12-17 05:44:48 +02:00
|
|
|
|
|
|
|
$(LIB): $(OBJS)
|
2013-01-07 13:21:00 +02:00
|
|
|
$(AR) cr $@ $^ || { rm -f $@; exit 1; }
|
2012-12-17 05:44:48 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJS)
|
|
|
|
|
|
|
|
spotless: clean
|
2013-01-07 16:47:53 +02:00
|
|
|
rm -f $(LIB) $(SHLIB)
|