Date:2013-01-07 12:21:00 (11 years 2 months ago)
Author:Werner Almesberger
Commit:64c14fb709eeb0243a20dcf18f95a7e0cbdd9ac2
Message:libubb/Makefile: build also a shared version of libubb; better cleanup

The improved cleanup removes the library after a partially successful build.
Files: libubb/Makefile (2 diffs)

Change Details

libubb/Makefile
11#
22# libubb/Makefile - Build the UBB library
33#
4# Written 2012 by Werner Almesberger
5# Copyright 2012 Werner Almesberger
4# Written 2012-2013 by Werner Almesberger
5# Copyright 2012-2013 Werner Almesberger
66#
77# This program is free software; you can redistribute it and/or modify
88# it under the terms of the GNU General Public License as published by
...... 
1313
1414TARGET = mipsel-openwrt-linux-
1515CC = $(TARGET)gcc
16LD = $(TARGET)ld
1617
17CFLAGS = -g -Wall -Iinclude
18CFLAGS = -g -Wall -fPIC -Iinclude
1819LIB = libubb.a
20SHLIB = libubb.so
21LIBVERSION = 0.0.0
1922
2023OBJS = ubb.o swuart.o
2124HDRS = ubb/ubb.h ubb/regbase.h ubb/regs4740.h ubb/swuart.h
2225
2326.PHONY: all clean spotless
2427
25all: $(LIB)
28all: $(SHLIB).$(LIBVERSION)
29
30$(SHLIB).$(LIBVERSION): $(SHLIB)
31        /sbin/ldconfig -n .
32
33$(SHLIB): $(LIB)
34        $(LD) -shared -soname $@.$(LIBVERSION) -o $@ \
35            --whole-archive $^ || { rm -f $@; exit 1; }
2636
2737$(LIB): $(OBJS)
28        $(AR) cr $@ $^
38        $(AR) cr $@ $^ || { rm -f $@; exit 1; }
2939
3040clean:
3141        rm -f $(OBJS)
3242
3343spotless: clean
34        rm -f $(LIB)
44        rm -f $(LIB) $(SHLIB) $(SHLIB).$(LIBVERSION)

Archive Download the corresponding diff file

Branches:
master



interactive