37
37
# Export all variables to sub-makes by default
38
38
export
39
39
40
- include Makefile.extrawarn
40
+ -include Makefile.inc
41
+ ifneq ($(MAKEFILE_INC_INCLUDED ) ,yes)
42
+ $(error Makefile.inc not generated, please configure first)
43
+ endif
41
44
42
- CC = @CC@
43
- LN_S = @LN_S@
44
- AR = @AR@
45
- RM = @RM@
46
- RMDIR = @RMDIR@
47
- INSTALL = @INSTALL@
48
- DISABLE_DOCUMENTATION = @DISABLE_DOCUMENTATION@
49
- DISABLE_BTRFSCONVERT = @DISABLE_BTRFSCONVERT@
50
- BTRFSCONVERT_EXT2 = @BTRFSCONVERT_EXT2@
51
45
TAGS_CMD := ctags
52
46
47
+ include Makefile.extrawarn
48
+
53
49
EXTRA_CFLAGS :=
54
50
EXTRA_LDFLAGS :=
55
51
@@ -60,7 +56,7 @@ DEBUG_CFLAGS :=
60
56
TOPDIR := $(shell pwd)
61
57
62
58
# Common build flags
63
- CFLAGS = @CFLAGS@ \
59
+ CFLAGS = $( SUBST_CFLAGS ) \
64
60
-include config.h \
65
61
-DBTRFS_FLAT_INCLUDES \
66
62
-D_XOPEN_SOURCE=700 \
@@ -72,19 +68,15 @@ CFLAGS = @CFLAGS@ \
72
68
$(DEBUG_CFLAGS_INTERNAL ) \
73
69
$(EXTRA_CFLAGS )
74
70
75
- LDFLAGS = @LDFLAGS@ \
71
+ LDFLAGS = $( SUBST_LDFLAGS ) \
76
72
-rdynamic -L$(TOPDIR ) $(EXTRA_LDFLAGS )
77
73
78
- LIBS_BASE = @UUID_LIBS@ @BLKID_LIBS@ -L. -pthread
79
- LIBS_COMP = @ZLIB_LIBS@ @LZO2_LIBS@
80
74
LIBS = $(LIBS_BASE )
81
75
LIBBTRFS_LIBS = $(LIBS_BASE )
82
76
83
77
# Static compilation flags
84
78
STATIC_CFLAGS = $(CFLAGS ) -ffunction-sections -fdata-sections
85
79
STATIC_LDFLAGS = -static -Wl,--gc-sections
86
- STATIC_LIBS_BASE = @UUID_LIBS_STATIC@ @BLKID_LIBS_STATIC@ -L. -pthread
87
- STATIC_LIBS_COMP = @ZLIB_LIBS_STATIC@ @LZO2_LIBS_STATIC@
88
80
STATIC_LIBS = $(STATIC_LIBS_BASE )
89
81
90
82
# don't use FORTIFY with sparse because glibc with FORTIFY can
@@ -124,14 +116,6 @@ TESTS = fsck-tests.sh convert-tests.sh
124
116
125
117
udev_rules = 64-btrfs-dm.rules
126
118
127
- prefix ?= @prefix@
128
- exec_prefix = @exec_prefix@
129
- bindir = @bindir@
130
- libdir ?= @libdir@
131
- incdir = @includedir@/btrfs
132
- udevdir = @UDEVDIR@
133
- udevruledir = ${udevdir}/rules.d
134
-
135
119
ifeq ("$(origin V ) ", "command line")
136
120
BUILD_VERBOSE = $(V )
137
121
endif
@@ -201,7 +185,6 @@ endif
201
185
202
186
# external libs required by various binaries; for btrfs-foo,
203
187
# specify btrfs_foo_libs = <list of libs>; see $($(subst...)) rules below
204
- btrfs_convert_libs = @EXT2FS_LIBS@ @COM_ERR_LIBS@
205
188
btrfs_convert_cflags = -DBTRFSCONVERT_EXT2=$(BTRFSCONVERT_EXT2 )
206
189
btrfs_fragments_libs = -lgd -lpng -ljpeg -lfreetype
207
190
btrfs_debug_tree_objects = cmds-inspect-dump-tree.o
@@ -514,7 +497,7 @@ clean-doc:
514
497
clean-gen :
515
498
@echo " Cleaning Generated Files"
516
499
$(Q )$(RM ) -rf -- version.h config.status config.cache connfig.log \
517
- configure.lineno config.status.lineno Makefile \
500
+ configure.lineno config.status.lineno Makefile.inc \
518
501
Documentation/Makefile tags \
519
502
config.log config.h config.h.in~ aclocal.m4 \
520
503
configure autom4te.cache/ config/
0 commit comments