# 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 want gradio to run setuid root (that is, if your kernel does
# not support radio cards, or does not recognize yours), change this to 1
# and uncomment the -DNO_KERNEL line as well.
SUID	= 0
#SUID	= 1


# The directory into which you want the binary installed
INSTALLDIR 	= /usr/local/bin
#INSTALLDIR	= /usr/bin
#INSTALLDIR	= .

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

CC	= pgcc
CFLAGS	= $(shell gtk-config --cflags) -g -O2 -Wall
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)

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

ifneq ($(SUID), 1)
install: gradio
	cp gradio $(INSTALLDIR)
endif

ifeq ($(SUID), 1)
install: gradio
	cp gradio $(INSTALLDIR)
	chown root.root $(INSTALLDIR)/gradio
	chmod 755 $(INSTALLDIR)/gradio
	chmod u+s $(INSTALLDIR)/gradio
endif

.c.o: $(HDRS)
	$(CC) -c $(CFLAGS) $(DEFS) $<
 
clean:
	rm -f *.o gradio *~ core
