#
# /emx/src/emxomf/makefile
#
# Copyright (c) 1992-1994 Eberhard Mattes
#
# This file is part of emx.
#
# emx 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, or (at your option)
# any later version.
#
# emx 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 emx; see the file COPYING.  If not, write to the
# Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#

.SUFFIXES: .c .o

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

OMFLIB=$(L)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 emxaout listomf
emxomf:		$(BIN)emxomf.exe
emxomfar:	$(BIN)emxomfar.exe
emxomfld:	$(BIN)emxomfld.exe
emxaout:	$(BIN)emxaout.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 -lomflib

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

$(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)emxaout.exe: emxaout.o grow.o
	-emxload -uw $(BIN)emxaout
	gcc -o $(BIN)emxaout.exe -s emxaout.o grow.o

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

emxomf.o: emxomf.c stabshll.h grow.h $(DEFS_H) $(S)omflib.h
stabshll.o: stabshll.c stabshll.h grow.h $(DEFS_H)
grow.o: grow.c grow.h $(DEFS_H)
emxomfar.o: emxomfar.c $(S)omflib.h
emxomfld.o: emxomfld.c $(DEFS_H) $(S)moddef.h
emxaout.o: emxaout.c grow.h $(DEFS_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)emxaout.exe
	-del $(BIN)listomf.exe

# End of /emx/src/emxomf/makefile
