Merge tag 'upstream/24.0'
[rrq/maintain_lilo.git] / Makefile
1 # -*- makefile -*-
2 #
3 # Copyright 2009-2013 Joachim Wiedorn
4 # All rights reserved.
5
6 # Licensed under the terms contained in the file 'COPYING'
7 # in the source directory.
8 #
9
10 #
11 #  make help
12 #
13 help:
14         @echo ""
15         @echo "Targets:"
16         @echo "  make all         # binaries (without dosexe, diag.)"
17         @echo "  make dosexe      # DOS lilo.com utility"
18         @echo "  make diagnostic  # standalone diagnostics"
19         @echo "  make alles       # all above + static binary"
20         @echo "  make docs        # doc/[user,tech].html docs"
21         @echo "  make floppy      # 2 standalone bootable diagnostic floppies"
22         @echo ""
23         @echo "  make install     # install binaries++ into root directory"
24         @echo "  make install DESTDIR=<dir>  # install binaries++ into directory"
25         @echo ""
26         @echo "  make uninstall     # remove binaries++ from root directory"
27         @echo "  make uninstall DESTDIR=<dir>  # rmove binaries++ from directory"
28         @echo ""
29         @echo "Maintenance:"
30         @echo "  make test        # test for all needed utilities (as86, ld86, etc.)"
31         @echo "  make tidy        # remove listings & other unnecessary files"
32         @echo "  make clean       # remove objects & ready for a fresh 'make all'"
33         @echo "  make distclean   # remove editor temps, & all of the above"
34         @echo ""
35
36 #
37 # everything needed to run, just short of installation
38 #
39 all: test
40         $(MAKE) -C src all
41         $(MAKE) -C images all
42
43 #
44 # everything above plus the statically linked version
45 #
46 alles: test
47         $(MAKE) -C src alles
48         $(MAKE) -C images all
49
50 #
51 # documentation files
52 #
53 docs:
54
55 #
56 # if you have the 'bcc' compiler, then you can make the diagnostics, too
57 # bcc = Bruce Evans’ C 16bit compiler (also for BIOS- and DOS code)
58 #
59 it:     docs alles diagnostic dosexe
60
61 #
62 # make the bootable diagnostic floppies
63 #
64 floppy: test
65         @echo
66         @echo Make sure you have 2 blank, formatted, 1.44Mb floppies
67         @echo before you proceed from this point.
68         @echo "Press <Enter> to continue, <^C> to abort ..."
69         @read
70         @$(MAKE) -C src floppy1
71         @echo Done.
72         @echo
73         @echo Remove the floppy from the drive.  Label it "\"1.6\""
74         @echo "Press <Enter> to continue, <^C> to abort ..."
75         @read
76         @$(MAKE) -C src floppy2
77         @echo Done.
78         @echo
79         @echo Remove the floppy from the drive.  Label it "\"2.4\""
80         @echo
81
82 diagnostic: test
83         $(MAKE) -C src diagnostic
84
85 dosexe: test
86         $(MAKE) -C dos lilo
87
88 #
89 # test for compilers & utilities
90 #
91 test: test.img
92 test.img:
93         ./checkit
94         echo Tested >test.img   
95
96 #
97 # shorthand install, if one knows that one has the 'bcc' compiler
98 #
99 ins:
100         $(MAKE) -C src ins
101
102 #
103 #  normal install, but doesn't make the diagnostic binaries
104 #
105 install:  all
106         $(MAKE) -C src install
107         $(MAKE) -C images install
108         $(MAKE) -C hooks install
109         $(MAKE) -C sample install
110         $(MAKE) -C scripts install
111         $(MAKE) -C man install
112         $(MAKE) -C dos install
113
114 tidy:
115         $(MAKE) -C src tidy
116         $(MAKE) -C diagnose tidy
117         $(MAKE) -C dos tidy
118
119 clean: tidy
120         rm -f test.img
121         $(MAKE) -C src clean
122         $(MAKE) -C images clean
123         $(MAKE) -C diagnose clean
124         $(MAKE) -C dos clean
125
126 spotless: distclean
127 distclean: clean
128         $(MAKE) -C src distclean
129         $(MAKE) -C diagnose distclean
130         $(MAKE) -C dos distclean
131
132 uninstall:
133         $(MAKE) -C src uninstall
134         $(MAKE) -C images uninstall
135         $(MAKE) -C hooks uninstall
136         $(MAKE) -C sample uninstall
137         $(MAKE) -C scripts uninstall
138         $(MAKE) -C man uninstall