# open source nserver.
# Authors:
# Sean Billings (theloft@megadon.co.uk) 27/03/00 updated 20/07/2001 12/07/2005
# Mod'ed by BaeHat (25/10/2009) baehat@baehat.dk

# Contributors:
# Jan Kratchovil (Serial Comms Advice)
# Marcus Groeber (Protocol Advice)
# Markus Almroth (FreeBSD fixes)
# Michael Kukat (Sun Patch)
# Panu Matilainen (fixcase patch)
# Ciaran Anscomb (SUN patch for fixcase)

# Serial Device
NOKIA_PORT = "/dev/ttyS0"
#NOKIA_PORT = "/dev/ttyb" # an example SUN device
NOKIA_SPEED = 19200

# Operating System (SUN/SGI/LINUX/OS2/BSD):
# Only tested so far with the below, let me know if you have a new one
OPSYS = LINUX
#OPSYS = BSD
#OPSYS = SUN

# C compiler:
CC = gcc

# C flags:
FLAGS = -D$(OPSYS) '-DDEFAULT_PORT=$(NOKIA_PORT)' -DDEFAULT_SPEED=$(NOKIA_SPEED) #-O2
ifeq ($(OPSYS),SUN)
	CFLAGS = $(FLAGS) -L/usr/ucblib/ -I/usr/include -I/usr/ucbinclude #-lucb
else
	CFLAGS = $(FLAGS) -I/usr/include #-fexceptions
endif

# Object files:
OBJ = crc.o charmap.o nserver.o 

# Make:
all: nserver

nserver: $(OBJ)
	$(CC) $(CFLAGS) -o nserver $(OBJ)

# Header file dependencies:
nserver.o: nserver.h
crc.o: crc.h
charmap.o: charmap.h

# Make clean
clean:
	rm -f *.o core

