# Makefile 
#
# WMAppl - Window Maker Application Launcher
# Copyright (C) 1999-2000 Casey Harkins
# 
# Based on Makefile from wmstock, which in turn
# was based off of the Makefile from wmWeather

OBJS    = wmappl.o dockapp.o xpmbutton.o rcparser.o args.o fileexists.o
TARGET  = wmappl
VERSION = 0.61

# compilation and installation variables
CC      = gcc
CFLAGS  = -O2 -pedantic -Wall
INCDIR  = -I/usr/X11R6/include/X11 -I/usr/X11R6/include
LIBDIR  = -L/usr/X11R6/lib
DESTDIR = /usr/X11R6/bin
DOCDIR  = /usr/doc/wmappl
ICONDIR = /usr/share/icons/wmappl

# for linux
LIBS   = -lXpm -lX11 -lXext
# for Solaris
# LIBS   = -lXpm -lX11 -lXext -lsocket

.c.o:
	$(CC) $(CFLAGS) -c $< -o $*.o $(INCDIR)

all:	$(TARGET)

$(TARGET):	$(OBJS) 
	$(CC) $(CFLAGS) -o $(TARGET) $^ $(INCDIR) $(LIBDIR) $(LIBS)

clean:
	for i in $(OBJS) ; do \
		rm -f $$i; \
	done
	rm -f core
	rm -f $(TARGET)

install-all: install install-docs install-icons

remove-all: remove remove-docs remove-icons

install: $(TARGET)
	install -c -s -m 0755 $(TARGET) $(DESTDIR)

remove:
	rm -f $(DESTDIR)/$(TARGET)

install-docs:
	install -d $(DOCDIR)
	install -m 644 README LICENSE CHANGELOG sample.wmapplrc $(DOCDIR)

remove-docs:
	rm -rf $(DOCDIR)  
  
install-icons:
	install -d $(ICONDIR)
	install -m 644 -c icons/*.xpm $(ICONDIR)

remove-icons:
	rm -rf $(ICONDIR)  
