#
# Makefile for 'joystick4doom'
#

RM = rm -f
CC = gcc
#DEBUG = -g -DDEBUG

# Set this to the percentage of joystick motion at which the player moves
# Comment this for a good default setting.
#THRESHOLD = -DTHRESHOLD=20

# Define this to be the file where the joystick settings are saved.
DATFILE = \"/usr/local/lib/joystick.dat\"

CFLAGS = -O2 $(DEBUG) $(THRESHOLD) -I. -DJOYSTICK_DAT=$(DATFILE)
XLDPATH = -L/usr/X11R6/lib
LDFLAGS = -s
XLIBS = -lX11

SRCS = joystick4doom.c
OBJS = joystick4doom.o
XBIN = joystick4xdoom
SBIN = joystick4sdoom
PRGS = $(XBIN) $(SBIN)

all: $(PRGS) $(SRCS)

$(XBIN):
	$(CC) -DX11 $(CFLAGS) $(LDFLAGS) $(SRCS) -o $(XBIN) $(XLDPATH) $(XLIBS)

$(SBIN):
	$(CC) $(CFLAGS) $(LDFLAGS) $(SRCS) -o $(SBIN)

clean:
	$(RM) $(OBJS) $(PRGS)
