# Makefile for par                                            12 Sep 1993
#
# - for GNU gcc (emx 0.8g kit) under OS/2 2.x or DOS (32-bit)
# - for Microsoft C 6.00a under OS/2 or MSDOS (16-bit)

# tested with dmake 3.8 and GNU make 3.68 under OS/2

default:
	@echo "Enter $(MAKE) target                                    "
	@echo " where 'target' is chosen from                          " 
	@echo "   msc      OS/2 exe [Microsoft C 6.00a]                "
	@echo "   mscbnd   OS/2 and DOS exe [Microsoft C 6.00a]        "
	@echo "   emx      OS/2 32-bit exe [EMX/gcc; uses emxlibc.dll] "
	@echo "   emxbnd   OS/2 and DOS 32-bit exe [EMX/gcc]           "

emx:  
	$(MAKE) all \
	CC="gcc -Zomf -Zmtd -O -s" O=".obj" \
	CFLAGS="" \
	LFLAGS="-Zstack 0x10000"  \
	DEF="par.def"
emxbnd:  
	$(MAKE) all \
	CC="gcc -O -s" O=".o" \
	CFLAGS="" \
	LFLAGS=""  \
	DEF="par.def"

msc: 
	$(MAKE) all \
	CC="cl -nologo -AC" O=".obj" \
	CFLAGS="" \
	LFLAGS="-Lp" \
	DEF="par.def" 

mscbnd: 
	$(MAKE) all \
	CC="cl -nologo -AC" O=".obj" \
	CFLAGS="" \
	LFLAGS="-Lp -Fb" \
	DEF="par.def" 

.SUFFIXES: $O

RM = rm

all : par.exe

OBJS = buffer$O charset$O errmsg$O par$O reformat$O

.c$O:
	$(CC) $(CFLAGS) -c $<

par.exe: $(OBJS) $(DEF)
	$(CC) -o $@ $(LFLAGS) $(OBJS) $(DEF)

buffer$O: buffer.c buffer.h errmsg.h

charset.o: charset.c charset.h errmsg.h buffer.h

errmsg$O: errmsg.c errmsg.h

par$O: par.c charset.h errmsg.h buffer.h reformat.h

reformat$O: reformat.c reformat.h buffer.h errmsg.h

clean:
	$(RM) par.exe *.o *.obj
