implemented for static library
| @@ -22,6 +22,8 @@ | ||
| 22 | 22 | ACLOCAL_DIR = $(datadir)/cwbase/$(VERSION)/ |
| 23 | 23 | DESTDIR = |
| 24 | 24 | |
| 25 | +LIBRARY = @LIBRARY@ | |
| 26 | + | |
| 25 | 27 | CONFIG_GENERATED = Makefile config.cache config.log config.status libtool \ |
| 26 | 28 | configure.lineno autom4* gc/autom4* |
| 27 | 29 | AUTOCONF_GENERATED = $(CONFIG_GENERATED) configure |
| @@ -32,15 +34,18 @@ | ||
| 32 | 34 | ANSI_CFLAGS = -ansi -pedantic-errors |
| 33 | 35 | CFLAGS = -O2 $(ANSI_CFLAGS) $(WARN_CFLAGS) -I. -g |
| 34 | 36 | |
| 35 | -BASE_OBJS = object.o autorelease_pool.o byte_order.o string.o array.o link.o list.o iter.o zone.o exception.o log.o stream.o data.o value.o file.o | |
| 37 | +LIBRARY_OBJS = object.o autorelease_pool.o byte_order.o string.o array.o link.o list.o iter.o zone.o exception.o log.o stream.o data.o value.o file.o | |
| 36 | 38 | |
| 37 | 39 | .c.o: |
| 38 | 40 | $(CC) -c $(CFLAGS) -o $@ $< |
| 39 | 41 | |
| 40 | -all: baselib | |
| 42 | +all: $(LIBRARY) | |
| 41 | 43 | |
| 42 | -baselib: $(BASE_OBJS) | |
| 44 | +$(LIBRARY): $(LIBRARY_OBJS) | |
| 45 | + $(AR) cr $@ $(LIBRARY_OBJS) | |
| 46 | + $(RANLIB) $@ | |
| 43 | 47 | |
| 44 | 48 | clean: |
| 45 | 49 | rm -rf $(CONFIG_GENERATED) |
| 46 | - rm -rf $(BASE_OBJS) | |
| 50 | + rm -rf $(LIBRARY_OBJS) | |
| 51 | + rm -rf $(LIBRARY) |
| @@ -62,6 +62,7 @@ | ||
| 62 | 62 | LIBRARY='libcwbase.a' |
| 63 | 63 | |
| 64 | 64 | AC_PROG_RANLIB |
| 65 | +AC_SUBST(LIBRARY) | |
| 65 | 66 | AC_SUBST(AR) |
| 66 | 67 | AC_CHECK_PROGS(AR, ar aal, ar) |
| 67 | 68 |