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

CFLAGS += -I../include -I../boot -I../../include \
	  -DZFCPDUMP_DIR=$(ZFCPDUMP_DIR) \
	  -DZFCPDUMP_IMAGE=$(ZFCPDUMP_IMAGE) -DZFCPDUMP_RD=$(ZFCPDUMP_RD) \
	  -D_FILE_OFFSET_BITS=64
objects = misc.o proc.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) -s -c zipl $(BINDIR)

clean:
	rm -f *.o zipl

.PHONY: all install clean

# Additional manual dependencies

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

