#pragma ident "@(#) makefile 2.0.2 2009.09.22,17:29"
# cw.mk
#		%Z% %M% %I% %D% %T%
#
#
# ロードモジュール名
TARGET	= cw
OFILES  = $(OBJ)/cw.o $(OBJ)/filer.o $(OBJ)/dtree.o $(OBJ)/ase.o $(OBJ)/cmsfiler.o

SRC	= .
OBJ	= .
INCLUDE	= ../ftx

LOAD = /home/cms/bin

CPP	= g++
CC	= gcc

# for Debug
#CFLAGS	= -g -X a -Wno-deprecated $(INC_OPT)

# for Release (-xcg92: use SPARC Version8 instructions.)
CPPFLAGS	= -O3
#CPPFLAGS	= -ggdb -DCYGWIN
CFLAGS	= -O3

LDEXE	= ./

LINTFLAGS = -x $(INC_OPT) $(CDEFS)

#all : $(LDEXE)/$(TARGET)

$(LDEXE)/$(TARGET) : $(OFILES) ../ftx/libftx.a
	$(CPP) $(CPPFLAGS) $(OFILES) -o $@ ../ftx/libftx.a ../libsubform/libsubform.a -lncursesw

$(OBJ)/cw.o : $(SRC)/cw.cc $(INCLUDE)/ftx.h $(INCLUDE)/filer.h ../ftx/libftx.a ../libsubform/libsubform.a
	$(CPP) -c $(CPPFLAGS) -o $@ $(SRC)/cw.cc

$(OBJ)/filer.o : $(SRC)/filer.cc $(INCLUDE)/ftx.h $(INCLUDE)/filer.h ../ftx/libftx.a ../libsubform/libsubform.a
	$(CPP) -c $(CPPFLAGS) -o $@ $(SRC)/filer.cc

$(OBJ)/dtree.o : $(SRC)/dtree.cc $(INCLUDE)/ftx.h $(INCLUDE)/filer.h ../ftx/libftx.a ../libsubform/libsubform.a
	$(CPP) -c $(CPPFLAGS) -o $@ $(SRC)/dtree.cc

$(OBJ)/ase.o : $(SRC)/ase.cc $(INCLUDE)/ftx.h $(INCLUDE)/filer.h ../ftx/libftx.a ../libsubform/libsubform.a
	$(CPP) -c $(CPPFLAGS) -o $@ $(SRC)/ase.cc

$(OBJ)/cmsfiler.o : $(SRC)/cmsfiler.cc $(INCLUDE)/ftx.h $(INCLUDE)/filer.h ../ftx/libftx.a ../libsubform/libsubform.a
	$(CPP) -c $(CPPFLAGS) -o $@ $(SRC)/cmsfiler.cc

$(OBJ)/jmvwgetnstr.o : $(SRC)/jmvwgetnstr.c
	$(CC) -c $(CFLAGS) -o $@ $(SRC)/jmvwgetnstr.c

cmsfiler: cmsfiler.c
	gcc -I../libsubform -c cmsfiler.c
	gcc -O -o cmsfiler cmsfiler.o ../libsubform/libsubform.a -lncursesw

lint:	;
	lint $(LINTFLAGS) $(SRC)/userdisp.c

clean	:
	-rm -f $(OFILES) $(TARGET)

install	:
	cp -p $(LDEXE)cw $(LOAD)
