2004-02-15 20:46:45 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# (c) 2004 Laurent Vivier <LaurentVivier@wanadoo.fr>
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
2004-12-07 00:35:33 +00:00
|
|
|
TOP = $(shell pwd)
|
|
|
|
VPATH = $(TOP)
|
|
|
|
|
2005-11-21 21:18:48 +00:00
|
|
|
ASFLAGS = -I$(TOP)
|
|
|
|
|
2005-11-16 14:00:27 +00:00
|
|
|
SOURCES = first.S
|
2005-11-08 02:05:45 +00:00
|
|
|
|
2005-11-16 14:00:27 +00:00
|
|
|
HEADERS =
|
|
|
|
|
|
|
|
MEDIA = floppy
|
|
|
|
|
|
|
|
ifeq ($(MEDIA), scsi)
|
|
|
|
MEDIAFLAGS = --defsym SCSI_SUPPORT=1
|
|
|
|
TARGET = scsi
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(MEDIA), floppy)
|
|
|
|
MEDIAFLAGS = --defsym FLOPPY_SUPPORT=1
|
|
|
|
TARGET = floppy
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(MEDIA), ata)
|
|
|
|
MEDIAFLAGS = --defsym ATA_SUPPORT=1
|
|
|
|
TARGET = ata
|
|
|
|
endif
|
|
|
|
|
|
|
|
PROGRAMS = first
|
|
|
|
|
|
|
|
all: $(TARGET)/first
|
2004-02-15 20:46:45 +00:00
|
|
|
|
|
|
|
first: first.o
|
2004-12-07 00:35:33 +00:00
|
|
|
$(OBJCOPY) -O binary $^ $@
|
2004-02-15 20:46:45 +00:00
|
|
|
|
2005-11-16 14:00:27 +00:00
|
|
|
first.o: first.S
|
|
|
|
$(AS) $(ASFLAGS) $(MEDIAFLAGS) -o $@ $^
|
2004-12-07 00:35:33 +00:00
|
|
|
|
2005-11-16 14:00:27 +00:00
|
|
|
$(TARGET)/first::
|
|
|
|
test -d $(TARGET) || mkdir $(TARGET)
|
|
|
|
cd $(TARGET) && make -f $(TOP)/Makefile TOP=$(TOP) AS=$(AS) \
|
|
|
|
OBJCOPY=$(OBJCOPY) "MEDIAFLAGS=$(MEDIAFLAGS)" \
|
|
|
|
first
|
2004-02-15 20:46:45 +00:00
|
|
|
|
2005-11-08 02:05:45 +00:00
|
|
|
install::
|
|
|
|
install -d $(DESTDIR)/$(PREFIX)/boot/emile/
|
2005-11-16 14:00:27 +00:00
|
|
|
install scsi/first $(DESTDIR)/$(PREFIX)/boot/emile/first_scsi
|
2005-11-08 02:05:45 +00:00
|
|
|
install -d $(DESTDIR)/$(PREFIX)/lib/emile/
|
2005-11-16 14:00:27 +00:00
|
|
|
install floppy/first $(DESTDIR)/$(PREFIX)/lib/emile/first_floppy
|
2005-11-08 02:05:45 +00:00
|
|
|
|
|
|
|
uninstall::
|
|
|
|
rm -f $(DESTDIR)/$(PREFIX)/boot/emile/first_scsi
|
|
|
|
rm -f $(DESTDIR)/$(PREFIX)/lib/emile/first_floppy
|
|
|
|
|
2005-11-16 14:00:27 +00:00
|
|
|
include $(TOP)/../Rules.mk
|