aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGrant Erickson <gerickson@nuovations.com>2008-06-18 07:35:39 -0700
committerJosh Boyer <jwboyer@gmail.com>2008-07-03 09:31:17 -0400
commit88730cb3f01f6b43f53faa3333f508ac9bc42916 (patch)
tree76f9bedf5ff1fc10a4949d275e872ad05d5cf755 /Makefile
parent230b13b2d9b109b5c166b4b0334609b52b452d12 (diff)
Makefile: Add Optional ZLIB and LZO CPPFLAGS and LDFLAGS
This adds support for allowing the specification of unique CPPFLAGS and LDFLAGS for both LZO and ZLIB. In addition, it allows for independently specifying both PREFIX and EXEC_PREFIX. The former is useful in some cross-compilation environments where the LZO and ZLIB versions being built against are not those installed in the standard locations. The latter is useful when installing mtd-utils in a multi-architecture installation area. Signed-off-by: Grant Erickson <gerickson@nuovations.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index c5d1933..32ee917 100644
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,17 @@
# -*- sh -*-
-SBINDIR=/usr/sbin
-MANDIR=/usr/share/man
-INCLUDEDIR=/usr/include
+PREFIX=/usr
+EXEC_PREFIX=$(PREFIX)
+SBINDIR=$(EXEC_PREFIX)/sbin
+MANDIR=$(PREFIX)/share/man
+INCLUDEDIR=$(PREFIX)/include
#CROSS=arm-linux-
CC := $(CROSS)gcc
CFLAGS ?= -O2 -g
CFLAGS += -Wall
-CPPFLAGS += -I./include
+CPPFLAGS += -I./include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
ifeq ($(origin CROSS),undefined)
BUILDDIR := .
@@ -65,13 +67,13 @@ $(BUILDDIR)/mkfs.jffs2: $(BUILDDIR)/crc32.o \
$(BUILDDIR)/compr_lzo.o \
$(BUILDDIR)/compr.o \
$(BUILDDIR)/rbtree.o
- $(CC) $(LDFLAGS) -o $@ $^ -lz -llzo2
+ $(CC) $(LDFLAGS) -o $@ $^ $(ZLIBLDFLAGS) -lz $(LZOLDFLAGS) -llzo2
$(BUILDDIR)/flash_eraseall: $(BUILDDIR)/crc32.o $(BUILDDIR)/flash_eraseall.o
$(CC) $(LDFLAGS) -o $@ $^
$(BUILDDIR)/jffs2reader: $(BUILDDIR)/jffs2reader.o
- $(CC) $(LDFLAGS) -o $@ $^ -lz
+ $(CC) $(LDFLAGS) -o $@ $^ $(ZLIBLDFLAGS) -lz
$(BUILDDIR)/jffs2dump: $(BUILDDIR)/jffs2dump.o $(BUILDDIR)/crc32.o
$(CC) $(LDFLAGS) -o $@ $^