1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-12-28 18:35:11 +02:00
ben-blinkenlights/libubb/Makefile

45 lines
998 B
Makefile
Raw Normal View History

2012-12-17 05:44:48 +02:00
#
# libubb/Makefile - Build the UBB library
#
# 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
LD = $(TARGET)ld
2012-12-17 05:44:48 +02:00
CFLAGS = -g -Wall -fPIC -Iinclude
2012-12-17 05:44:48 +02:00
LIB = libubb.a
SHLIB = libubb.so
LIBVERSION = 0.0.0
2012-12-17 05:44:48 +02:00
OBJS = ubb.o swuart.o
HDRS = ubb/ubb.h ubb/regbase.h ubb/regs4740.h ubb/swuart.h
2012-12-17 05:44:48 +02:00
.PHONY: all clean spotless
all: $(SHLIB).$(LIBVERSION)
$(SHLIB).$(LIBVERSION): $(SHLIB)
/sbin/ldconfig -n .
$(SHLIB): $(LIB)
$(LD) -shared -soname $@.$(LIBVERSION) -o $@ \
--whole-archive $^ || { rm -f $@; exit 1; }
2012-12-17 05:44:48 +02:00
$(LIB): $(OBJS)
$(AR) cr $@ $^ || { rm -f $@; exit 1; }
2012-12-17 05:44:48 +02:00
clean:
rm -f $(OBJS)
spotless: clean
rm -f $(LIB) $(SHLIB) $(SHLIB).$(LIBVERSION)