New upstream release with many bugfixes
[rrq/maintain_lilo.git] / dos / Makefile
1 # -*- makefile -*-
2 #
3 # Copyright 2009-2014 Joachim Wiedorn
4 # All rights reserved.
5
6 # Licensed under the terms contained in the file 'COPYING'
7 # in the source directory.
8 #
9 # Makefile for BCC compilation of 'lilo.com'
10 #
11 # Known to work with BCC version 0.16.15
12 # Known not to work with BCC version 0.16.10
13
14 # adding variables
15 include ../make.vars
16
17 MODEL=d
18 CC = bcc -M$(MODEL)
19 CPP = gcc -E
20 CINCL = /usr/lib/bcc/include
21 AS = as86
22 LINK = $(CC) -v
23 COPT = -ansi -I.. -I$(CINCL) -c -O $(CFLAGS)
24 LOPT = -m >$*.map -M -d
25 AOPT = -0 -a -w
26 CFLAGS = -DLCF_IGNORECASE -DLCF_DSECS=3 -DLCF_PASS160
27
28 .SUFFIXES:      .com .S
29
30 HFILES = ../src/lilo.h ../src/bitmap.h ../src/cfg.h ../src/config.h ../src/common.h ../src/map.h ../src/temp.h ../src/version.h
31
32 .c.o:
33         $(CC) $(COPT) -o $@ ../$*.c
34
35 .o.com:
36         $(LINK) $(LOPT) -o $@ $^
37
38 .s.o:
39         $(AS) $(AOPT) -l $*.lis -o $@ $<
40
41
42
43
44 all:    check lilo.com
45
46 alles:  all
47         cp -ufv lilo.com lilo.map /dosC/boot
48
49 check:
50         @echo $(CFLAGS)
51         @if [ -x /usr/bin/bcc -o -x /usr/local/bin/bcc ]; then echo Okay; \
52         else echo; echo "You don't seem to have the 'bcc' compiler from the 'dev86' package."; \
53                 echo; exit 1; fi
54
55 lilo:
56         make -e CFLAGS="$(PCONFIG)" lilo.com
57
58 lilo.com:       lilo.o common.o cfg.o map.o   # cprintf.o
59
60 lilo.o:         ../src/lilo.c $(HFILES)
61         $(CC) $(COPT) -o $@  ../src/$*.c
62
63 cfg.o:          ../src/cfg.c $(HFILES)
64         $(CC) $(COPT) -o $@  ../src/$*.c
65
66 common.o:       ../src/common.c $(HFILES)
67         $(CC) $(COPT) -o $@  ../src/$*.c
68
69 cprintf.o:      ../src/cprintf.c $(HFILES)
70         $(CC) $(COPT) -o $@  ../src/$*.c
71
72 map.o:          ../src/map.c $(HFILES)
73         $(CC) $(COPT) -o $@  ../src/$*.c
74
75
76 install:
77         if [ -d $$DESTDIR$(DOS_DIR) -a -f lilo.com ]; then \
78           cp lilo.com $$DESTDIR$(DOS_DIR); fi
79
80 tidy:
81         rm -f *.map *.lis core
82
83 clean:  tidy
84         rm -f *.o *.s *.img *.b *.com *.gz
85
86 distclean:  clean
87         rm -f *~ *.c *.h
88