#
# File:		makefile.unx
# Author:	Julian Smart
# Created:	1993
# Updated:	
# Copyright:	(c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile for layout example (UNIX).

WXDIR = ../..

# All common UNIX compiler flags and options are now in
# this central makefile.
include $(WXDIR)/src/make.env

OBJECTS=$(OBJDIR)/layout.$(OBJSUFF)

.SUFFIXES:

all:	$(OBJDIR) layout$(GUISUFFIX)

wxmotif:
	cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx motif

wxxview:
	cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview

wxhp:
	cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx hp

# For SGI, include -lPW on your LDLIBS
motif:	wxmotif
	$(MAKE) -f makefile.unx all GUISUFFIX=_motif GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' WXLIB=$(WXDIR)/lib/libwx_motif.a OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' XVIEW_LINK=

xview:	wxxview
	$(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol CC=$(CC) OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' LDLIBS='$(XVIEWLDLIBS)'

hp:	wxhp
	$(MAKE) -f makefile.unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC OPT='' DEBUG='$(DEBUG)' WARN='-w' \
           XINCLUDE='$(HPXINCLUDE)' \
           XLIB='$(HPXLIB)' \
           XVIEW_LINK='' \
           LDLIBS='$(HPLDLIBS)'

$(OBJDIR):
	mkdir $(OBJDIR)

layout$(GUISUFFIX): $(OBJDIR)/layout.$(OBJSUFF) $(WXLIB)
	$(CC) $(LDFLAGS) -o layout$(GUISUFFIX) $(OBJDIR)/layout.$(OBJSUFF) $(XVIEW_LINK) $(LDLIBS)

$(OBJDIR)/layout.$(OBJSUFF):        layout.$(SRCSUFF) layout.h
	$(CC) -c $(CPPFLAGS) -o $@ layout.$(SRCSUFF)

clean_motif:
	$(MAKE) -f makefile.unx GUISUFFIX=_motif cleanany

clean_ol:
	$(MAKE) -f makefile.unx GUISUFFIX=_ol cleanany

clean_hp:
	$(MAKE) -f makefile.unx GUISUFFIX=_hp cleanany

cleanany:
	rm -f $(OBJECTS) layout$(GUISUFFIX) core

wxclean_ol:
	cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_ol

wxclean_motif:
	cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_motif

wxclean_hp:
	cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_hp

