EMILE/Makefile

119 lines
3.4 KiB
Makefile
Raw Normal View History

2004-02-15 20:46:45 +00:00
#
#
# (c) 2004 Laurent Vivier <LaurentVivier@wanadoo.fr>
#
#
PACKAGE = emile
2004-05-19 00:09:58 +00:00
VERSION = 0.4CVS
2004-02-15 20:46:45 +00:00
2004-06-03 11:09:28 +00:00
# build info
WHO = $(shell whoami)
WHERE = $(shell hostname)
WHEN = $(shell LANG=C date)
ARCH = $(shell uname -m -o)
SIGNATURE = $(PACKAGE)-$(VERSION) $(WHO)@$(WHERE)($(ARCH)) $(WHEN)
2004-02-15 20:46:45 +00:00
# tools to use
ifneq ($(shell uname -m),m68k)
CROSS_COMPILE = m68k-linux-
endif
AS=$(CROSS_COMPILE)as
CC=$(CROSS_COMPILE)gcc
LD=$(CROSS_COMPILE)ld
OBJCOPY=$(CROSS_COMPILE)objcopy
# identify architecture of kernel (Motorola 680x0 or PowerPC)
KERNEL=vmlinux
FILE=file -bknL
KERNEL_ARCH=$(filter Motorola PowerPC, $(shell $(FILE) $(KERNEL) | cut -d"," -f 2))
2004-06-03 09:13:05 +00:00
KERNEL_SIZE=$(shell ls -l vmlinux.bin | awk '{print $$5}')
2004-06-02 21:10:19 +00:00
RAMDISK=$(shell ls ramdisk.gz 2> /dev/null)
2004-05-21 15:06:35 +00:00
all: floppy.img
2004-02-15 20:46:45 +00:00
floppy.img: tools first/first vmlinuz second/second $(RAMDISK)
2004-06-02 21:10:19 +00:00
ifeq ($(RAMDISK),ramdisk.gz)
tools/emile-install -f first/first -s second/second \
-i vmlinuz -b $(KERNEL_SIZE) \
-r $(RAMDISK) \
floppy.img.X
2004-06-02 21:10:19 +00:00
tools/emile-set-cmdline floppy.img.X \
"root=/dev/ramdisk ramdisk_size=2048"
else
tools/emile-install -f first/first -s second/second \
-i vmlinuz -b $(KERNEL_SIZE) \
floppy.img.X
tools/emile-set-cmdline floppy.img.X \
2004-06-03 22:59:11 +00:00
"root=/dev/nfs ip=dhcp nfsroot=192.168.100.1:/mnt/usb-storage/nfsroot rw"
2004-06-02 21:10:19 +00:00
endif
2004-02-15 20:46:45 +00:00
mv floppy.img.X floppy.img
vmlinux.bin: $(KERNEL)
$(OBJCOPY) -O binary -R .note -R .comment -S $(KERNEL) vmlinux.bin
2004-02-15 20:46:45 +00:00
vmlinuz: vmlinux.bin
cp vmlinux.bin vmlinuz.out
gzip -9 vmlinuz.out
mv vmlinuz.out.gz vmlinuz
first/first::
2004-06-03 11:09:28 +00:00
$(MAKE) -C first OBJCOPY=$(OBJCOPY) LD=$(LD) CC=$(CC) AS=$(AS) SIGNATURE="$(SIGNATURE)"
2004-02-15 20:46:45 +00:00
second/second::
$(MAKE) -C second OBJCOPY=$(OBJCOPY) LD=$(LD) CC=$(CC) AS=$(AS) \
2004-06-03 11:09:28 +00:00
VERSION=$(VERSION) KERNEL_ARCH=$(KERNEL_ARCH) SIGNATURE="$(SIGNATURE)"
2004-05-19 00:09:58 +00:00
tools::
2004-06-03 11:09:28 +00:00
$(MAKE) -C tools all VERSION=$(VERSION) SIGNATURE="$(SIGNATURE)"
2004-05-19 00:09:58 +00:00
2004-02-15 20:46:45 +00:00
dump: floppy.img
dd if=floppy.img of=/dev/fd0 bs=512
eject /dev/fd0
clean:
2004-05-21 15:06:35 +00:00
$(MAKE) -C tools clean
2004-02-15 20:46:45 +00:00
$(MAKE) -C first clean
$(MAKE) -C second clean
rm -f floppy.img floppy.img.X vmlinuz vmlinux.bin
2004-03-04 22:51:23 +00:00
DISTFILES = second/head.S second/MMU030.c second/MMU040.c second/main.c \
second/MMU030.h second/MMU040.h second/console.c \
second/Makefile second/console.h second/printf.c \
second/MMU030_asm.S second/MMU040_asm.S second/uncompress.h \
second/font_8x16.c second/ld.script second/memory.c \
second/inflate.c second/uncompress.c second/misc.c \
second/bootinfo.h second/misc.h second/lowmem.h \
second/bootinfo.c second/glue.h second/memory.h \
second/glue.S second/enter_kernel030.S \
second/load.h second/load.c \
2004-03-04 22:51:23 +00:00
second/enter_kernel040.S first/first.S \
first/Makefile second/bank.c second/bank.h second/arch.h \
2004-05-19 00:09:58 +00:00
second/arch.c Makefile COPYING README AUTHORS ChangeLog \
2004-06-01 22:08:15 +00:00
tools/Makefile tools/emile-first.h tools/emile-second.h \
tools/emile-set-cmdline.c tools/emile-first-info.c \
tools/emile-first-tune.c tools/emile.h \
tools/emile-install.c
2004-02-15 20:46:45 +00:00
dist:
rm -fr $(PACKAGE)-$(VERSION)
mkdir $(PACKAGE)-$(VERSION)
for file in $(DISTFILES); do \
dir=$$(dirname $$file); \
if [ "$$dir" != "" ] ; then \
mkdir -p $(PACKAGE)-$(VERSION)/$$dir; \
fi; \
cp -p $$file $(PACKAGE)-$(VERSION)/$$file; \
done
rm -f $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION).tar.bz2
tar cvf $(PACKAGE)-$(VERSION).tar $(PACKAGE)-$(VERSION)
bzip2 -9 $(PACKAGE)-$(VERSION).tar
rm -fr $(PACKAGE)-$(VERSION)