From 88730cb3f01f6b43f53faa3333f508ac9bc42916 Mon Sep 17 00:00:00 2001 From: Grant Erickson Date: Wed, 18 Jun 2008 07:35:39 -0700 Subject: 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 Signed-off-by: Josh Boyer --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Makefile') 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 $@ $^ -- cgit v1.2.3