# Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details
# Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details
CC = gcc
BIN = .
INC = ../include
CFLAGS = -O2 -fomit-frame-pointer -I$(INC)
LDFLAGS = -s
BINDIR = /usr/i386-go32/bin

all : stubedit stubify exe2coff $(INC)/stubinfo.h djasm

install : all
	install -s -m 755 stubify stubedit exe2coff djasm $(BINDIR)
	install -m 755 coff2exe $(BINDIR)

stubify.o : stub.h

$(INC)/stubinfo.h : stub.asm stub.map stub2inc
	stub2inc stub.map stub.asm $(INC)/stubinfo.h

djasm.c : djasm.y
	bison -y djasm.y
	mv y.tab.c djasm.c

stub.h stub.map : stub.asm djasm
	djasm stub.asm stub.h stub.map

stubedit.o : $(INC)/stubinfo.h

stub2inc : stub2inc.o strupr.o
	$(CC) $(LDFLAGS) -o stub2inc stub2inc.o strupr.o

clean ::
	-rm -f djasm stubedit stubify stub2inc exe2coff $(INC)/stubinfo.h
	-rm -f djasm.c stub.h stub.map *.o *.d *~ core
 