1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
PREFIX=/usr
LIBDIR=$(install_root)$(DESTDIR)$(PREFIX)/lib
INCDIR=$(install_root)$(DESTDIR)$(PREFIX)/include
#CFLAGS += -Wall -g -ansi -pedantic
OBJS = uundo.o uundo_debug.o
all: libuundo.a
libuundo.a: $(OBJS)
@touch $@
@rm $@
@ar ru $@ $(OBJS)
-ar s $@
-ranlib $@
uundo.o: uundo.c uundo.h
$(CC) -c $(CFLAGS) uundo.c -o uundo.o
uundo_debug.o: uundo_debug.c uundo_debug.h
$(CC) -c $(CFLAGS) uundo_debug.c -o uundo_debug.o
install_:
mkdir -p $(LIBDIR) $(INCDIR)
$(CP) `pwd`/libuundo.a $(LIBDIR)/libuundo.a
$(CP) `pwd`/uundo.h $(INCDIR)/uundo.h
$(CP) `pwd`/uundo_debug.h $(INCDIR)/uundo_debug.h
uninstall:
rm $(LIBDIR)/libuundo.a $(INCDIR)/uundo.h $(INCDIR)/uundo_debug.h
install:
make install_ CP="cp"
linstall:
make install_ CP="ln -s"
clean:
rm $(OBJS) libuundo.a 2>/dev/null; true
|