##############################################################################
#																			 #
#	Makefile for XICE - X-Window Linice Loader								 #
#																			 #
#	(c) 2000-2005 Goran Devic												 #
#	(c) "Linice" by Goran Devic												 #
#	(c) "Linsym" by Goran Devic												 #
#																			 #
##############################################################################

#-----------------------------------------------------------------------------
# List of include directories
#-----------------------------------------------------------------------------

H    = ../include
LIBS = -L/usr/X11R6/lib
LIB  = -lX11 -lXxf86dga -lXext

LINKFLAGS = $(LIBS) $(LIB)

#-----------------------------------------------------------------------------
# Compiler defines:
#   make				- engineering non-debug build (default)
#	make debug			- engineering debug build
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Compiler defines: Engineering NON-DEBUG build (default)
#-----------------------------------------------------------------------------

CFLAGS = -O3 -I$(H)

#-----------------------------------------------------------------------------
# Compiler defines: Engineering DEBUG build (Development)
#-----------------------------------------------------------------------------
ifeq ($(MAKECMDGOALS),debug)

CFLAGS = -Wall -O -I$(H)

endif
#-----------------------------------------------------------------------------
# Compiler that is used.
#-----------------------------------------------------------------------------

CC = gcc

#-----------------------------------------------------------------------------
# Formal targets
#-----------------------------------------------------------------------------

debug:	../bin/xice

nd:		../bin/xice

all:	../bin/xice

clean:
	rm -f ../bin/xice
	rm -f *.o *~ core

#-----------------------------------------------------------------------------
# List of object modules that build the target
#-----------------------------------------------------------------------------

../bin/xice:	xice.o
	$(CC) $^ -o xice $(LINKFLAGS)
	cp xice ../bin/xice
	chmod +x ../bin/xice

xice.o:	xice.c
	$(CC) $(CFLAGS) -c xice.c
