File: Makefile

package info (click to toggle)
ocfs2-tools 1.8.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 6,232 kB
  • sloc: ansic: 86,865; sh: 5,781; python: 2,380; makefile: 1,305
file content (113 lines) | stat: -rw-r--r-- 2,750 bytes parent folder | download | duplicates (2)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
TOPDIR = ..

include $(TOPDIR)/Preamble.make

sbindir = $(root_sbindir)
SBIN_PROGRAMS = fsck.ocfs2

DEFINES += -DVERSION=\"$(VERSION)\"

INCLUDES = -I$(TOPDIR)/include -Iinclude
LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
ifneq ($(BUILD_FSDLM_SUPPORT),)
LIBO2CB_LIBS += -ldlm_lt
endif
ifneq ($(BUILD_CMAP_SUPPORT),)
LIBO2CB_LIBS += -lcmap
endif
LIBTOOLS_INTERNAL_LIBS = -L$(TOPDIR)/libtools-internal -ltools-internal
LIBTOOLS_INTERNAL_DEPS = $(TOPDIR)/libtools-internal/libtools-internal.a

ifndef OCFS2_DYNAMIC_FSCK
LDFLAGS += -static
endif

CFILES =	fsck.c		\
		dirblocks.c 	\
		dirparents.c 	\
		extent.c 	\
		icount.c 	\
		journal.c 	\
		pass0.c 	\
		pass1.c 	\
		pass1b.c 	\
		pass2.c 	\
		pass3.c 	\
		pass4.c 	\
		pass5.c		\
		problem.c 	\
		refcount.c	\
		slot_recovery.c \
		strings.c 	\
		util.c		\
		xattr.c

HFILES = 	include/fsck.h		\
		include/xattr.h		\
		include/dirblocks.h	\
		include/dirparents.h	\
		include/extent.h	\
		include/icount.h	\
		include/journal.h	\
		include/pass0.h		\
		include/pass1.h		\
		include/pass1b.h	\
		include/pass2.h		\
		include/pass3.h		\
		include/pass4.h		\
		include/pass5.h		\
		include/problem.h	\
		include/refcount.h	\
		include/slot_recovery.h	\
		include/o2fsck_strings.h	\
		include/util.h


OBJS = $(subst .c,.o,$(CFILES))
MANS = fsck.ocfs2.8 fsck.ocfs2.checks.8

DIST_FILES = $(CFILES) $(HFILES) $(addsuffix .in,$(MANS))
DIST_RULES = dist-subdircreate

dist-subdircreate:
	$(TOPDIR)/mkinstalldirs $(DIST_DIR)/include

fsck.ocfs2: $(OBJS) $(LIBOCFS2_DEPS) $(LIBO2DLM_DEPS) $(LIBO2CB_DEPS) $(LIBTOOLS_INTERNAL_DEPS)
	$(LINK) $(LIBOCFS2_LIBS) $(LIBO2DLM_LIBS) $(LIBO2CB_LIBS) $(LIBTOOLS_INTERNAL_LIBS) $(COM_ERR_LIBS) $(AIO_LIBS)

$(OBJS): prompt-codes.h

# make it hard to add a prompt call
# without documenting what it does
prompt-codes.h: fsck.ocfs2.checks.8.in
	@echo generating $@ by parsing $^
	@rm -f .$@.tmp
	@(	echo '#ifndef __PROMPT_CODES_H__';			\
		echo '#define __PROMPT_CODES_H__';			\
		for a in `grep '^.SS ".*"' $^ | awk -F\" '{print $$2}'`; do\
			echo '#define PR_'$$a' \';			\
			echo '	(struct prompt_code){ .str = "'$$a'" }';\
		done;							\
		echo '#endif';						\
	 ) > $@

.PHONY: check-prompt-dups
check-prompt-dups: fsck.ocfs2
	@rm -f .$@.tmp
	@nm $^ | \
		awk -F'[ .]' '/fsck_prompt_callers_with_code/ {print $$3}' | \
		sort | uniq -c | awk '($$1 > 1){print $$0}' > .$@.tmp
	@cat .$@.tmp
	@test ! -s .$@.tmp

CLEAN_RULES += o2fsck-clean
.PHONY: o2fsck-clean
o2fsck-clean:
	rm -f prompt-codes.h

include $(TOPDIR)/Postamble.make