Makefile

Tue, 15 Feb 2005 18:57:52 +0100

author
tailor@f281.ttorni.ton.tut.fi
date
Tue, 15 Feb 2005 18:57:52 +0100
changeset 0
86b7f6f9c5c0
child 1
6e704fc09528
permissions
-rw-r--r--

Tailorization of trunk
Import of the upstream sources from the repository

http://tao.uab.es/ion/svn/libtu/trunk

as of revision 2

#
# libtu Makefile
#

# Where to install? ($PREFIX/lib/libtu.a, $PREFIX/include/libtu/)
#
PREFIX=/usr/local

# Any extra defines needed
#
#DEFINES=

# Any extra include paths needed
#
#INCLUDES=

######################################

WARN=	-W -Wimplicit -Wreturn-type -Wswitch -Wcomment \
	-Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized \
	-Wparentheses -pedantic-errors

CC_FLAGS=-g -O2 -ansi $(DEFINES) $(INCLUDES) $(WARN)
CC=gcc
AR=ar
AR_FLAGS=crs

INSTALL=install
MODE=644

######################################

OBJS= misc.o output.o util.o optparser.o parser.o tokenizer.o
	
DEPEND= .depend

LIBDIR=$(PREFIX)/lib
INCDIR=$(PREFIX)/include/libtu

TARGETS=libtu.a
TESTERS=tester tester2 tester3

######################################

all: $(TARGETS)

testers: $(TESTERS)

libtu.a: $(OBJS)
	$(AR) $(AR_FLAGS) $@ $+

%: %.c
	$(CC) $(CC_FLAGS) $+ -L. -ltu -lm -o $@

%.o: %.c
	$(CC) $(CC_FLAGS) -c $< -o $@

clean:
	rm -f $(OBJS) $(DEPEND)

realclean: clean
	rm -f $(TARGETS)

depend:
	$(CC) -M $(CC_FLAGS) *.c > $(DEPEND)

install:
	$(INSTALL) -d $(LIBDIR)
	$(INSTALL) -d $(INCDIR)
	$(INSTALL) -m $(MODE) libtu.a $(LIBDIR)
	$(INSTALL) -m $(MODE) include/* $(INCDIR)

ifeq ($(DEPEND),$(wildcard $(DEPEND)))
include $(DEPEND)
endif

mercurial