################################################
#    This is the Makefile for smix             #
################################################

#
# Version of the program.
#
VERSION = 1.2

#
# (New) name of the program.
#
#PRG_NAME = -DPRG_NAME=\"mixer\"

#
# New name of config file.
# (~ at the beginning will be substituted with the 
#    actual user's home directory.)
#
#CONFIGFILE = -DCONFIGFILE=\"~/.smix.conf\"
#CONFIGFILE = -DCONFIGFILE=\"~/.smixrc\"


#
# New default mixer device.
#
#DEFAULT_MIXERDEVICE = -DDEFAULT_MIXERDEVICE=\"/dev/mixer\"
#DEFAULT_MIXERDEVICE = -DDEFAULT_MIXERDEVICE=\"/dev/mixer1\"

#
# Defines
#
.SUFFIXES: .cc .o .h

CC = gcc
CCFLAGS = -O2 -Wall -I/usr/X11R6/include/X11
#CCFLAGS = -O6 -m486 -Wall -I/usr/X11R6/include/X11
#CCFLAGS = -g -Wall -I/usr/X11R6/include/X11

LIB_PATH = -L/usr/X11R6/lib
LIBS = $(LIB_PATH) -lX11 -lXpm -lm -lforms

DEFS = -DVERSION=\"$(VERSION)\"

#
# Dependicies and Targets
#

SRCS = smix.c mybutton.c

OBJS = smix.o mybutton.o

INCLUDES=/usr/X11R6/include/X11

all: smix

install: all
	install -s smix /usr/local/bin
	install smix.1 /usr/local/man/man1

static: $(OBJS)
#	$(CC) $(OBJS) -L/usr/X11R6/lib /usr/lib/libforms.a /usr/X11R6/lib/libXpm.a -lX11 -lm $(LIBS_LAND) -o $@
	$(CC) $(OBJS) -L/usr/X11R6/lib /usr/lib/libforms.a -lX11 -lm $(LIBS_LAND) -o $@

smix:	$(OBJS)
	$(CC) $(OBJS) $(LIBS) $(LIBS_LAND) -o $@

clean:
	rm -f *~ *.o smix DEADJOE a.out static .smix.conf

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

arch:	clean
	cd ..; tar zcvf smix-$(VERSION).tar.gz smix-$(VERSION)/*

depend:	$(SRCS)
	makedepend -I. $(SRCS)

