File: Makefile

package info (click to toggle)
m68k-vme-tftplilo 1.0.0-1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 316 kB
  • ctags: 637
  • sloc: ansic: 5,475; makefile: 78
file content (89 lines) | stat: -rw-r--r-- 2,677 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
##--------------------------------------------------------------------------##
#
# VME Linux/m68k TFTP Boot Loader
#
# Makefile
#

# Possible options:
#
# BOOTINFO_COMPAT_1_0:
#   Include support for booting kernel with bootinfo version 1.0 (up to 2.0.x)
#
# DEFAULT_CONFIG_FILE_NAME:
#   The default name of the boot loader configuration file. It may include
#   one or more %C, %S, %G, %B or %M escape sequences that will be replaced
#   with the corresponding IP address in the form of n.n.n.n (see substip()).
#   With the BVME and MVME versions it is possible to override this default
#   by configuring the boot ROMs to pass a parameter string to "tftplilo"
#   which it uses as the configuration file name.
#
OPTIONS				=	-DBOOTINFO_COMPAT_1_0 \
						-DDEFAULT_CONFIG_FILE_NAME=\"tftplilo.conf\"

DESTDIR				=	
CROSS_COMPILE		=	#m68k-linux-

AS					=	$(CROSS_COMPILE)as
LD					=	$(CROSS_COMPILE)ld
CC					=	$(CROSS_COMPILE)gcc
CFLAGS				=	-O2 -fomit-frame-pointer -Wall -m68060 $(OPTIONS)
INSTALL				=	install
MAKE				=	make

COMMON_FILES		=	head.o main.o misc.o config.o boot.o stream.o \
					 	memory_mod.o gunzip_mod.o
BVME_FILES			=	$(COMMON_FILES) bvme.o
MVME_FILES			=	$(COMMON_FILES) mvme.o

##--------------------------------------------------------------------------##
# Targets
#
all: tftplilo.bvme tftplilo.mvme

tftplilo.bvme:	$(BVME_FILES) bvme.ld
				$(LD) -T bvme.ld $(BVME_FILES) -o tftplilo.bvme \
					-oformat binary -M >tftplilo.bvme.map

tftplilo.mvme:	$(MVME_FILES) mvme.ld
				$(LD) -T mvme.ld $(MVME_FILES) -o tftplilo.mvme \
					-oformat binary -M >tftplilo.mvme.map

##--------------------------------------------------------------------------##
# Dependencies
#
gunzip_mod.o	: defs.h bootinfo.h stream.h inflate.c
$(COMMON_FILES) : defs.h bootinfo.h stream.h
bvme.o          : defs.h bootinfo.h bvmbug.h
mvme.o			: defs.h bootinfo.h mvmebug.h

##--------------------------------------------------------------------------##
# Installation
#

install:	tftplilo.bvme tftplilo.mvme
	$(INSTALL) -o root -g disk -m 2775 -d $(DESTDIR)/boot
	$(INSTALL) -o root -g root -m 0644 tftplilo.bvme $(DESTDIR)/boot/
	$(INSTALL) -o root -g root -m 0644 tftplilo.mvme $(DESTDIR)/boot/

##--------------------------------------------------------------------------##
# Clean up
#

clean:
		rm -f *.bvme *.mvme *.o *.map

dist:
		make clean
		make all
		rm -f *.o *.map
		tar -C .. -cvzf ../$$(basename $$(pwd)).tgz $$(basename $$(pwd))

##--------------------------------------------------------------------------##
# General rules
#

%.o:			%.c
				$(CC) $(CFLAGS) -c $< -o $*.o

##-----------------------------< end of file >------------------------------##