#
# This program is free software; you can redistribute
# it and/or modify it under the terms of the GNU
# General Public License ...

SHELL = /bin/sh

#### Start of system configuration section. ####

srcdir = ./

# If you use gcc, you should either run the
# fixincludes script that comes with it or else use
# gcc with the -traditional option.  Otherwise ioctl
# calls will be compiled incorrectly on some systems.

CC = gcc -O6
INSTALL = install -c
INSTALLDATA = install -c -m 644

LIBS = -lbz2
# CDEBUG = -g
CFLAGS = 
# LDFLAGS = -g

prefix = /usr/local
# Prefix for each installed program,
# normally empty or `g'.
binprefix =

# The directory to install tar in.
bindir = $(prefix)/bin

# The directory to install the info files in.
infodir = $(prefix)/info

#### End of system configuration section. ####

SRC = libitar.c libitar_bz.c itar.c
OBJ = libitar.o libitar_bz.o itar.o
# ar -q  libmart.a reverse.o for static library

# while for dynamic use gcc -fpic -g -c -Wall mylist.cpp
# then gcc -shared -Wl,-soname,libmylist.so.1 -o libmylist.so.1.0. 1mylist.o -lc
all:    itar
	@echo "Done"

itar:	libitar.o libitar_bz.o itar.o
	$(CC) $(LIBS) $(LDFLAGS) -o ../../bin/$@ $^

libitar.o: libitar.h libitar_private.h libitar.c
#	$(CC) -c $(CFLAGS) -o libitar.o libitar.c
libitar_bz.o: libitar_bz.h libitar_bz.c
#	$(CC) -c $(CFLAGS) -o libitar_bz.o libitar_bz.c
itar.o: itar.c
#	$(CC) -c $(CFLAGS) -o itar.o itar.c


.PHONY : clean
clean :
	-rm  ../../bin/itar $(OBJ)

#install: all
#        $(INSTALL) bin/* $(bindir)/bin
#        # $(INSTALLDATA) $(srcdir)/tar.info* $(infodir)

# $(OBJS): tar.h port.h testpad.h
# regex.o buffer.o tar.o: regex.h

#clean:
#        rm -f *.o tar rmt testpad testpad.h core

