CFLAGS += -Wall -D_XOPEN_SOURCE=500 -O3 -fPIC \
-D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 \
-D_LFS_LARGEFILE=1 -D_LFS64_LARGEFILE=1 \
-D_FILE_OFFSET_BITS=64 `getconf LFS_CFLAGS 2>/dev/null`
ifdef DEBUG
CFLAGS += -g -pg -fprofile-arcs -ftest-coverage
endif
ifdef STRICT
CFLAGS += -ansi -pedantic
endif
# prefix for installing the binaries
PREFIX=/usr/local
OBJS = libfilo.o
default: all
all: libfilo.so libfilo.a
libfilo.so: $(OBJS)
$(CC) -shared -fPIC $(OBJS) -o libfilo.so
libfilo.a: $(OBJS)
$(AR) cr libfilo.a $(OBJS)
install: all
install -d $(PREFIX)/lib
install -m 0755 libfilo.so $(PREFIX)/lib
install -m 0644 libfilo.a $(PREFIX)/lib
install -d $(PREFIX)/include
install -m 0644 libfilo.h $(PREFIX)/include
install -d $(PREFIX)/man/man3
install -m 0644 doc/libfilo.3 $(PREFIX)/man/man3/
@echo
@echo "Please run ldconfig to update your library cache"
@echo
.c.o:
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
clean:
rm -f $(OBJS) libfilo.a libfilo.so
rm -f *.bb *.bbg *.da *.gcov gmon.out
.PHONY: default all install python python_install clean