# $Source: /hpux/shared/supp//usr/src/cmd/nljust/./makefile,v $
# $Revision: 72.2 $

# Common makefile for building nljust

FLAGS 	 = -DUSG
OBJFILES = global.o main.o line.o dojust.o arab_con.o \
	   arab_fnt.o arab_fun.o arab_shp.o hpux_rel.o
SRCFILES = global.c main.c line.c dojust.c arab_con.c \
	   arab_fnt.c arab_fun.c arab_shp.c hpux_rel.c
MSGSRC 	 = global.msg main.msg line.msg dojust.msg arab_con.msg \
	   arab_fnt.msg arab_fun.msg arab_shp.msg hpux_rel.msg
FINDMSG	 = /usr/bin/findmsg
GENCAT	 = /usr/bin/gencat

default: nljust nljust.cat

metrics: nljust.M

nljust:	$(OBJFILES)
	$(CC) $(LDFLAGS) -o nljust $(OBJFILES)

nljust.M: $(SRCFILESS)
	$(METRICS) $(CFLAGS) -o nljust.M $(SRCFILES)

$(OBJFILES): justify.h extern.h arab_def.h 

clean:
	rm -f $(OBJECTS) *.msg

clobber: clean
	rm -f nljust nljust.cat

# Redefine the .c to .o rule so that it will also use FLAGS
.c.o:
	$(CC) $(CFLAGS) $(FLAGS) -c $<

nljust.cat: $(MSGSRC)
	$(GENCAT) $@ $(MSGSRC)

.c.msg:
	$(FINDMSG) $*.c >$*.msg

.msg.cat:
	$(GENCAT) $*.cat $*.msg

.SUFFIXES: .cat .msg
