# Makefile for stest + sio
#
# http://www.cryptsoft.com/scard/
#
# Tim Hudson
# tjh@cryptsoft.com
# 30-Aug-97
#
#

VERSION=1_11e
TARFILE=sio$(VERSION).tar
COMPRESS=gzip
OTHER=Makefile stest.mak README COPYING VERSION PORTING \
      sio.sdf stest.sdf links.sdf \
      sio.html stest.html links.html 
OSRCS=

DEBUG=-Wall -g

# Linux 2.x
CC = gcc
CFLAGS = -DLINUX $(DEBUG)
LIBS =

# SunOS 5.x - aka Solaris 2.x
#CFLAGS = -DSUNOS5 $(DEBUG)

# FreeBSD/NetBSD
#CFLAGS = -DUSE_TERMIOS -DDEFAULT_DEVICE=\"/dev/ttyd1\" $(DEBUG)
# OpenBSD
#CFLAGS = -DUSE_TERMIOS -DDEFAULT_DEVICE=\"/dev/cuaC0\" $(DEBUG)

# SCO 
#CFLAGS = -DSCO $(DEBUG)

SRCS=sio.c sct0.c tscam.c stest.c sc.c scstr.c scatr.c scasc.c \
     sccards.c slog.c scint.c strutil.c \
     sc_cflex.c sc_dx.c sc_ck.c sc_gsm.c
OBJS=$(SRCS:.c=.o)
HDRS=sio.h sct0.h options.h platform.h varadic.h slog.h sc.h scint.h \
	strutil.h

stest: $(OBJS)
	$(CC) $(CFLAGS) -o stest $(OBJS) $(LIBS)

sio.o : sio.c sio.h
	$(CC) $(CFLAGS) -c sio.c -o sio.o

stest.o : stest.c sio.h
	$(CC) $(CFLAGS) -c stest.c -o stest.o

clean:
	/bin/rm -f *.o stest *.mdp *.ncb

tar:
	/bin/rm -f $(TARFILE) $(TARFILE).Z $(TARFILE).gz
	tar cf $(TARFILE) $(SRCS) $(HDRS) $(OSRCS) $(OTHER)
	$(COMPRESS) $(TARFILE)


