# If you want the standard cyan-on-black LED color display,
# change this to STD_COLOR. You can also change colors in pixmaps.h
COLOR	= NO_STD_COLOR
#COLOR	= STD_COLOR

# If you live in Japan (or possibly elsewhere), you will need to uncomment
# one or both. GRadio uses driver-reported allowable frequency ranges, but
# not all drivers report these properly. Defining this sets a wider range
# of allowable frequencies; if your hardware cannot actually do this, the
# results may be unpredictable. WIDE_FREQ uses driver returns if possible,
# otherwise it uses a wider-than-normal (76.1-108.9 MHz) range. Setting
# OVERRIDE_FREQ will cause the driver-supplied values to be ignored.
#CFLAGS		+= -DWIDE_FREQ
#CFLAGS		+= -DOVERRIDE_FREQ

# If your 2.[12] kernel headers aren't in /usr/include(/linux),
# you'll need to specify their location here.
#KERNELINCS	= /usr/src/linux/include

# The directory into which you want to install
INSTALLROOT 	= /usr/local

# The directories in which the binary and man page should
# be installed.
BINDIR		= $(INSTALLROOT)/bin
MANDIR		= $(INSTALLROOT)/man/man1

# The device to access by default (can be changed at runtime)
DEVICE		= /dev/radio

# These should be OK ---------------------------------------

CC	= cc
ALL_CFLAGS	= $(shell gtk-config --cflags) -O2 -Wall $(CFLAGS) -I$(KERNELINCS)
LIBS	= $(shell gtk-config --libs)
SRCS	= ui.c gradio-main.c callbacks.c interface.c lowlevel.c
OBJS	= $(SRCS:.c=.o)
HDRS	= gradio.h pixmaps.h logo.h
DEFS	= -D$(COLOR) -DDEV_NAME=\"$(DEVICE)\"

all: $(SRCS) $(HDRS) $(OBJS)
	$(CC) -o gradio $(OBJS) $(ALL_CFLAGS) $(LIBS)

install: gradio
	cp gradio $(BINDIR)
	cp gradio.1 $(MANDIR)

.c.o: $(HDRS)
	$(CC) -c $(ALL_CFLAGS) $(DEFS) $<

clean:
	rm -f *.o gradio *~ core
