#
# Makefile.noimke for xvmpeg.
# For use if you do not have imake.
# Created by Alexandre Naaman <hoser@step.polymtl.ca>
#

CC     = gcc
CFLAGS = -O2 -Wall 
#CFLAGS = -O2 -Wall -m486 

# Define the base directory for installation here
#DESTDIR=$(HOME)
DESTDIR=$(OPENWINHOME)
#OPENWINHOME=/usr/openwin

LIBS   = -lxview -lolgx -lX11 
LPATH = -L/usr/X11/lib -L$(OPENWINHOME)/lib 
EXTRA_INC= -I$(OPENWINHOME)

#####################################################
# Do not change anything beyond this point.
#####################################################

VERSION = 0.1a
SRCS = xvmpeg.c
OBJECTS = xvmpeg.o

MKDIRHIER=mkdirhier

all: xvmpeg

xvmpeg: $(OBJECTS)
	$(CC) $(CFLAGS) $(EXTRA_INC) -o xvmpeg $(OBJECTS) $(LPATH) $(LIBS)

install.all: install

install: xvmpeg
	if [ -d $(DESTDIR)/bin ]; then set +x;\
	else (set -x; $(MKDIRHIER) $(DESTDIR)/bin); fi
	install -s xvmpeg $(DESTDIR)/bin
	if [ -d $(DESTDIR)/lib/help ]; then set +x;\
	else (set -x; $(MKDIRHIER) $(DESTDIR)/lib/help); fi	
	install -m 0444 xvmpeg.info $(DESTDIR)/lib/help/xvmpeg.info
	if [ -d $(DESTDIR)/man/man1 ]; then set +x;\
	else (set -x; $(MKDIRHIER) $(DESTDIR)/man/man1); fi	
	install -m 0444 xvmpeg.man $(DESTDIR)/man/man1/xvmpeg.1x
	@echo
	@echo "Don't forget to take a look at the man page and the"
	@echo "README file for info on how to setup xvmpeg."
	@echo
	@echo "Please take the time to send some mail to me at"
	@echo "(hoser@step.polymtl.ca) if you like this program"
	@echo

backup:
	cd ..; tar cvf xvmpeg-$(VERSION).tar xvmpeg-$(VERSION)
	cd ..; gzip -f xvmpeg-$(VERSION).tar

clean: 
	rm -r $(OBJECTS) *~ *.o

# Dependencies:
xvmpeg.o: xvmpeg.c xvmpeg.h xvmpeg.xbm xvmpeg_mask.xbm
