#
# /emx/src/emxomf/makefile
#
# Copyright (c) 1992, 1993 Eberhard Mattes
#
# This file is part of emxomf and emxomfar.
#
# See COPYING for details.
#

.SUFFIXES: .c .o

BIN=\emx\bin\ #
LIB=\emx\lib\ #
I=d:/emx/include/
S=$(I)sys/
L=d:/emx/lib/

OMFLIB=$(LIB)omflib.a
DEFS_H=../include/defs.h
CC=gcc
CFLAGS=-c -O -Wall -I../include

.c.o:
	$(CC) $(CFLAGS) $<

default:	all
all:		emxomf emxomfar emxomfld listomf
emxomf:		$(BIN)emxomf.exe
emxomfar:	$(BIN)emxomfar.exe
emxomfld:	$(BIN)emxomfld.exe
listomf:	$(BIN)listomf.exe

$(BIN)emxomf.exe: emxomf.o stabshll.o grow.o $(OMFLIB)
	-emxload -uw $(BIN)emxomf
	gcc -o $(BIN)emxomf.exe -s emxomf.o stabshll.o grow.o $(OMFLIB)

$(BIN)emxomfar.exe: emxomfar.o $(OMFLIB)
	-emxload -uw $(BIN)emxomfar
	gcc -o $(BIN)emxomfar.exe -s emxomfar.o $(OMFLIB)

$(BIN)emxomfld.exe: emxomfld.o $(L)moddef.a
	-emxload -uw $(BIN)emxomfld
	gcc -o $(BIN)emxomfld.exe -s emxomfld.o -lmoddef
	emxbind -qa $(BIN)emxomfld.exe -p

$(BIN)listomf.exe: listomf.o
	gcc -o $(BIN)listomf.exe -s listomf.o

emxomf.o: emxomf.c stabshll.h grow.h $(DEFS_H) ../include/omflib.h
stabshll.o: stabshll.c stabshll.h grow.h $(DEFS_H)
grow.o: grow.c grow.h $(DEFS_H)
emxomfar.o: emxomfar.c ../include/omflib.h
emxomfld.o: emxomfld.c $(DEFS_H) $(S)moddef.h
listomf.o: listomf.c $(DEFS_H)

clean:
	-del *.o

realclean:
	-del $(BIN)emxomf.exe
	-del $(BIN)emxomfar.exe
	-del $(BIN)emxomfld.exe
	-del $(BIN)listomf.exe

# End of /emx/src/emxomf/makefile
