# Common definitions
include ../../common.mak

CFLAGS := -I../include -I../boot -O2 -Wall -DZFCPDUMP_DIR=$(ZFCPDUMP_DIR) \
          -DZFCPDUMP_IMAGE=$(ZFCPDUMP_IMAGE) -DZFCPDUMP_RD=$(ZFCPDUMP_RD) \
          -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) -D_FILE_OFFSET_BITS=64
objects = misc.o procpart.o error.o scan.o job.o boot.o bootmap.o disk.o \
	  install.o zipl.o
includes = $(wildcard ../include/*.h)

all: zipl

zipl: ../boot/data.c $(objects)
	$(CC) $(objects) -o zipl

%.o: %.c $(includes) Makefile
	$(CC) $(CFLAGS) -c -o $@ $<

install: all
	@echo $(INSTALL)
	$(INSTALL) -d -m 755 $(BINDIR)
	$(INSTALL) -c zipl $(BINDIR)

clean:
	rm -f *.o zipl

.PHONY: all install clean


# Additional manual dependencies

boot.o: ../boot/data.c
