From 66d0930cf68e6acf62bd505e0365e783bd14f981 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 11 Dec 2007 09:22:42 -0500 Subject: Makefile: CFLAGS, LDFLAGS Split CFLAGS into CFLAGS (user part) and AM_CFLAGS (not-so-user part; variable name taken from automake, but otherwise no relation). Also add LDFLAGS. This allows me to use `make CFLAGS="-O2 -fPIE" LDFLAGS="-pie"` without dropping the other important (AM_CFLAGS) flags. Signed-off-by: Jan Engelhardt --- btrfs-progs/Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) --- Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index b09d47be..03dbfdce 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ CC=gcc -CFLAGS = -g -Wall -fno-strict-aliasing -Werror -D_FILE_OFFSET_BITS=64 +AM_CFLAGS = -Wall -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 +CFLAGS = -g -Werror objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \ root-tree.o dir-item.o hash.o file-item.o inode-item.o \ inode-map.o crc32c.o rbtree.o extent-cache.o \ @@ -23,28 +24,28 @@ endif .c.o: $(check) $< - $(CC) $(DEPFLAGS) $(CFLAGS) -c $< + $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $< all: $(progs) btrfsctl: btrfsctl.o - gcc $(CFLAGS) -o btrfsctl btrfsctl.o + gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(LDFLAGS) btrfsck: $(objects) btrfsck.o bit-radix.o - gcc $(CFLAGS) -o btrfsck btrfsck.o $(objects) bit-radix.o + gcc $(CFLAGS) -o btrfsck btrfsck.o $(objects) bit-radix.o $(LDFLAGS) mkfs.btrfs: $(objects) mkfs.o - gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o -luuid + gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o -luuid $(LDFLAGS) debug-tree: $(objects) debug-tree.o - gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o -luuid + gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o -luuid $(LDFLAGS) dir-test: $(objects) dir-test.o - gcc $(CFLAGS) -o dir-test $(objects) dir-test.o + gcc $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) quick-test: $(objects) quick-test.o - gcc $(CFLAGS) -o quick-test $(objects) quick-test.o + gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) clean : rm -f $(progs) cscope.out *.o .*.d -- cgit v1.2.3