VPATH=src;src/bytearray;src/hashtab;src/ftebc
CC=gcc
CFLAGS=-O2
COPTS=-c $(CFLAGS) -ansi -Wall -fno-common -I./src \
  -I./src/ftebc \
  -I./src/bytearray -I./src/hashtab

OBJS=bytearray.obj elf.obj elf_bytearray.obj coff.obj \
  coff_bytearray.obj error.obj hashtab.obj hunk.obj ld.obj \
  libld.obj link.obj lx.obj lx_bytearray.obj map.obj read.obj \
  sections.obj symbols.obj xmalloc.obj int64sup.obj \
  aout.obj atari.obj mainframe.obj febc.obj tebc.obj \
  aout_bytearray.obj atari_bytearray.obj

TARGET=pdld.exe

all: clean $(TARGET)

$(TARGET): $(OBJS)
  $(CC) $(LDFLAGS) -o $(TARGET) $(OBJS)

.c.obj:
  $(CC) $(COPTS) -o $@ $<

clean:
  rm -f $(OBJS) $(TARGET)
