DESTDIR =
CC = gcc
DEFINES = -DDEBIAN
INCLUDES = -I/usr/X11R6/include -DXAW_INTERNATIONALIZATION -DXAW_MULTIPLANE_PIXMAPS -DXAW_GRAY_BLKWHT_STIPPLES -DXAW_ARROW_SCROLLBARS -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/uuid
CFLAGS = -O2 -Wall -fno-strength-reduce $(INCLUDES) $(DEFINES)

OBJS = help.o init.o popup.o util.o callbacks.o window.o main.o actions.o \
	functions.o

LIBS = -lX11 -lXmu -lXt -lXaw3dxft -lfontconfig -lXmu -lXt -lX11 -lXft -lfreetype

%.o: %.c
	$(CC) $(CFLAGS) -c $<

xless: $(OBJS)
	$(CC) $(CFLAGS) -o xless $(OBJS) $(LIBS)

install: xless
	mkdir -p $(DESTDIR)/usr/bin
	mkdir -p $(DESTDIR)/etc/X11/app-defaults
	install -m 0755 xless $(DESTDIR)/usr/bin
	install -c -m 0644 XLess.ad $(DESTDIR)/etc/X11/app-defaults/XLess
	install -c -m 0644 XLess-co.ad $(DESTDIR)/etc/X11/app-defaults/XLess-color

clean:
	rm -f *.o xless core
