dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / backup / dump / Makefile
blobdc83dcdc5af7c146bab6bc097c9d4a78982cf658
2 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
3 # Use is subject to license terms.
5 # cmd/backup/dump/Makefile
7 # Copyright (c) 1980 Regents of the University of California.
8 # All rights reserved. The Berkeley software License Agreement
9 # specifies the terms and conditions for redistribution.
11 # dump.h header file
12 # dumpfstab.c reads fstab/vfstab, mtab/mnttab
13 # dumpitime.c reads /etc/dumpdates
14 # dumpmain.c driver
15 # dumponline.c online dump support
16 # dumpoptr.c operator interface
17 # dumptape.c handles the mag tape and opening/closing
18 # dumptraverse.c traverses the file system
19 # lftw.c fixed version of ftw(3)
20 # partial.c partial filesystem dump support
21 # unctime.c undo ctime
23 # CPPFLAGS:
24 # DEBUG use local directory to find ddate and dumpdates
25 # PARTIAL enable partial filesystem dump support
26 # TDEBUG trace out the process forking
28 # CAUTION: FSTYPE must be defined before including ../Makefile.backup,
29 # otherwise UFSROOTPKGUSRLIBFSTYPE doesn't get expanded
30 # properly and the magic doesn't happen.
32 FSTYPE= ufs
34 include ../Makefile.backup
36 #CFLAGS += -DTDEBUG
37 UFSDUMP= ufsdump
39 PROG= $(UFSDUMP)
40 PRODUCT= $(PROG)
41 ROLLDIR= ../../fs.d/ufs/roll_log
42 ROLLOBJS= $(ROLLDIR)/$(MACH)/roll_log.o
43 ROLLSRCS= $(ROLLDIR)/roll_log.c
45 LOBJECTS= dumponline.o dumpfstab.o dumpitime.o dumpmain.o \
46 dumpoptr.o dumptape.o dumptraverse.o unctime.o \
47 partial.o lftw.o
48 OBJECTS= $(LOBJECTS) roll_log.o
49 SRCS= $(LOBJECTS:.o=.c)
51 POFILES= $(OBJECTS:.o=.po) ../lib/libdump.po
52 POFILE= ufsdump.po
53 ROLLPOFILES= roll_log.po
55 # XXX This is only needed for the check: target. It would be nice to
56 # XXX automatically generate the list when needed.
57 HEADERS= ../../../../../include/protocols/dumprestore.h \
58 ../../fs.d/ufs/roll_log/roll_log.h ../include/byteorder.h \
59 ../include/memutils.h \
60 dump.h dumpusg.h
62 CLOBBERFILES += $(PRODUCT) $(DEBUGPRODUCTS) dumpdates
64 LOCAL= .
65 GENERAL= ../include
66 GLOBAL= ../../../../../include
67 CPPFLAGS= -I$(LOCAL) -I$(GENERAL) -I$(GLOBAL) -DPARTIAL \
68 -I$(ROLLDIR) $(CPPFLAGS.master) \
69 -D_LARGEFILE64_SOURCE=1
70 CERRWARN += -Wno-implicit-function-declaration
71 CERRWARN += -Wno-parentheses
72 CERRWARN += -Wno-uninitialized
73 CERRWARN += -Wno-clobbered
74 CERRWARN += -Wno-extra
75 LIBDUMP= ../lib/libdump.a
76 LDLIBS += $(BSTATIC) -L../lib -ldump $(BDYNAMIC) \
77 -ladm -lm -lkstat
79 UFSROOTDUMPDATES= $(UFSROOTETC)/dumpdates
80 UFSROOTLINK= $(UFSROOTUSRSBIN)/$(PROG)
81 LINKVALUE= ../lib/fs/$(FSTYPE)/$(PROG)
82 LIBDIR= $(UFSROOTUSRLIBFS)/$(FSTYPE)
83 $(UFSROOTDUMPDATES):= FILEMODE= 0664
84 $(LIBDIR):= DIRMODE= 0755
86 FILEMODE= 04555
88 .KEEP_STATE:
90 all: $(PRODUCT)
92 $(PROG): $(OBJECTS) $$(LIBDUMP)
93 $(LINK.c) -o $@ $(OBJECTS) $(LDLIBS)
94 $(POST_PROCESS)
96 $(LIBDUMP): FRC
97 $(DO_LIBDIR)
99 $(POFILE): $(POFILES)
100 $(RM) $@; cat $(POFILES) > $@
102 FRC:
104 install: all $(LIBDIR) $(UFSROOTPKGUSRLIBFSTYPE) dumpdates \
105 $(UFSROOTDUMPDATES) $(UFSROOTLINK)
107 dumpdates:
108 cp /dev/null dumpdates
110 #XXX Should actually note return value from close(2), particularly regarding
111 #XXX tape descriptors. Some drives don't actually force anything to media
112 #XXX except when they are writing a file mark....
114 check: FRC
115 $(CSTYLE) $(CSTYLEFLAGS) $(SRCS) $(ROLLSRCS) $(HEADERS)
116 $(HDRCHK) $(HDRCHKFLAGS) $(HEADERS)
118 clean:
119 $(RM) $(OBJECTS) $(ROLLOBJS) $(DEBUGOBJS) *.ln
121 $(LIBDIR):
122 $(INS.dir)
124 $(UFSROOTLINK):
125 -$(RM) $@; $(SYMLINK) $(LINKVALUE) $(UFSROOTLINK)
127 roll_log.o:
128 cd $(ROLLDIR) ; pwd ; $(MAKE)
129 cp $(ROLLOBJS) .
132 .debug/roll_log.o:
133 cd $(ROLLDIR) ; pwd ; $(MAKE) CFLAGS=-g
134 cp $(ROLLOBJS) .debug
137 $(ROLLPOFILES): $(ROLLSRCS)
138 cd $(ROLLDIR) ; pwd ; $(MAKE) `echo $(ROLLPOFILES) | sed -e 's@$(ROLLDIR)/@@g'`
139 cp $(ROLLDIR)/*.po .
142 ../lib/libdump.po:
143 cd ../lib ; pwd ; $(MAKE) libdump.po
145 include ../Makefile.targ