/*
 * $Id: Imakefile,v 1.3 1993/07/28 19:13:41 hevi Exp hevi $
 *
 * CrossEdit - Game world editor
 * Copyright (C) 1993 Petri Heinila & Jarkko Sonninen
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * Authors can be connected by email from Jarkko.Sonninen@lut.fi &
 * Petri.Heinila@lut.fi
 */

#include "../config/crossfire.tmpl"

### subdirectories
#define IHaveSubdirs 
SUBDIRS = bitmaps doc Cnv include

### bindir fix ???, should this be in crossfire.tmpl
BINDIR = $(C_BINDIR)

### environment
LOCAL_LDFLAGS   = -L../common -L./Cnv
LOCAL_LIBRARIES =  -lcross -lCnv XawClientLibs
EXTRA_INCLUDES  = -I. -I../include -I./include -I./Cnv
EXTRA_DEFINES   =
DEPENDLIB = ../common/libcross.a ./Cnv/libCnv.a

### program
PROG = crossedit

### files
SRCS = \
	$(PROG).c \
	Attr.c \
	CrFace.c \
	CrEdit.c \
	CrList.c \
	CrUtil.c \
	Edit.c \
	App.c \
	Bitmaps.c \
	Str.c 

HDRS = \
	CrFace.h \
	CrFaceP.h \
	CrEdit.h \
	CrEditP.h \
	CrList.h \
	CrListP.h \
	CrUtil.h \
	App.h \
	Edit.h \
	Bitmaps.h \
	Str.h \
	Attr.h \
	Crossedit.ad.h \
	Defines.h 

OBJS = \
	$(PROG).o \
	Attr.o \
	CrFace.o \
	CrEdit.o \
	CrList.o \
	CrUtil.o \
	Edit.o \
	App.o \
	Bitmaps.o \
	Str.o 

FILES	=	README		TODO		Imakefile \
		Crossedit.ad	Crossedit.ad.h	config.h

########################################################################

MakeSubdirs(bitmaps doc Cnv include)

AllTarget($(PROG))

MakeArchieve(bitmaps doc Cnv include)

InsertArchieve($(SRCS) $(HDRS) $(FILES),crossedit)

depend:: Crossedit.ad.h

NormalProgramTarget($(PROG),$(OBJS),$(DEPENDLIB),$(LOCAL_LIBRARIES),/**/)

DependTarget()

### resources
crossedit.c: Crossedit.ad.h
Crossedit.ad.h: Crossedit.ad
	../utils/ad2c.script Crossedit.ad > Crossedit.ad.h

### indent
indent: $(SRCS)
	for a in $(SRCS) $(HDRS);do \
	indent $$a -bap -bacc -nbad -nbbb -nbc -br -bs -ncdb -ce -neei \
		-nfc1 -i4 -nip -nlp -npro -pcs -npsl -nsc -nsob \
		-c33 -cd33 -ci2 -cli0.0 -d0 -di4 -l78 -lc78;\
	done

### prototypes
proto:
	cextract +Ap -o proto.h -I$(INCROOT) $(EXTRA_INCLUDES) $(SRCS)
	chmod 664 proto.h

### clean
clean::
	$(RM) Crossedit.ad.h

### install
#if ProjectX < 5
install::
	@echo Can not install $(PROG) due to too low X-release.
#else
InstallProgram($(PROG),$(BINDIR))
#endif

### END OF IMAKEFILE ###
