]> git.ipfire.org Git - thirdparty/util-linux.git/blob - disk-utils/Makefile
Imported from util-linux-2.8 tarball.
[thirdparty/util-linux.git] / disk-utils / Makefile
1 # Makefile -- Makefile for util-linux Linux utilities
2 # Created: Sat Dec 26 20:09:40 1992
3 # Revised: Fri Oct 6 21:02:21 1995 by r.faith@ieee.org
4 # Copyright 1992, 1993, 1994, 1995 Rickard E. Faith (faith@cs.unc.edu)
5 #
6
7 include ../MCONFIG
8
9 # Where to put man pages?
10
11 MAN8= fdformat.8 mkswap.8 setfdprm.8
12
13 # Where to put binaries?
14 # See the "install" rule for the links. . .
15
16 SBIN= mkfs mkswap
17
18 USRBIN= fdformat setfdprm
19
20 ETC= fdprm
21
22 ifneq "$(CPU)" "sparc"
23 # fsck and mkfs will compile, but there is no kernel support on sparc
24 MAN8:=$(MAN8) fsck.minix.8 mkfs.8 mkfs.minix.8
25 SBIN:=$(SBIN) fsck.minix mkfs.minix
26 ifneq "$(CPU)" "m68k"
27 MAN8:=$(MAN8) fdisk.8 cfdisk.8 sfdisk.8
28 SBIN:=$(SBIN) fdisk cfdisk sfdisk
29 endif
30 else
31 MAN8:=$(MAN8) fdisk.8
32 SBIN:=$(SBIN) fdisk
33 endif
34
35 # Where to put datebase files?
36
37 all: $(SBIN) $(USRBIN)
38
39 cfdisk.o: cfdisk.c
40 ifeq "$(HAVE_SLANG)" "yes"
41 $(CC) -c $(CFLAGS) -DSLCURSES=1 $< -o $@
42 else
43 ifeq "$(HAVE_NCURSES)" "yes"
44 $(CC) -c $(CFLAGS) $< -o $@
45 else
46 :
47 endif
48 endif
49
50 cfdisk: cfdisk.o llseek.o
51 ifeq "$(HAVE_SLANG)" "yes"
52 $(CC) $(LDFLAGS) $^ -o $@ $(LIBSLANG)
53 else
54 ifeq "$(HAVE_NCURSES)" "yes"
55 $(CC) $(LDFLAGS) $^ -o $@ $(LIBCURSES) -lm
56 else
57 @echo $@ not made since it requires ncurses or slang
58 endif
59 endif
60
61 # not installed by default
62 activate: sfdisk
63 rm -f activate
64 ln -s sfdisk activate
65
66 # Rules for everything else
67
68 fdformat: fdformat.o
69 fsck.minix: fsck.minix.o
70 fsck.minix.o: fsck.minix.c bitops.h
71 mkfs: mkfs.o
72 mkfs.minix: mkfs.minix.o
73 mkfs.minix.o: mkfs.minix.c bitops.h
74 mkswap: mkswap.o
75 setfdprm: setfdprm.o
76 sfdisk: sfdisk.o
77
78 ifeq "$(CPU)" "sparc"
79 fdisk: fdisk.o fdisklabel.o fdisksunlabel.o llseek.o
80 fdisksunlabel.o: fdisksunlabel.c fdisksunlabel.h fdisk.h
81 else
82 fdisk: fdisk.o fdisklabel.o llseek.o
83 endif
84
85 fdisk.o: fdisk.c fdisk.h
86 fdisklabel.o: fdisklabel.c fdisk.h fdisklabel.h
87
88 install: all
89 $(INSTALLDIR) $(SBINDIR) $(USRBINDIR) $(ETCDIR)
90 $(INSTALLBIN) $(SBIN) $(SBINDIR)
91 $(INSTALLBIN) $(USRBIN) $(USRBINDIR)
92 $(INSTALLDAT) $(ETC) $(ETCDIR)
93 $(INSTALLDIR) $(MAN8DIR)
94 $(INSTALLMAN) $(MAN8) $(MAN8DIR)
95
96 .PHONY: clean
97 clean:
98 -rm -f *.o *~ core $(SBIN) $(USRBIN)