summaryrefslogtreecommitdiff
path: root/util/romtool/tools
diff options
context:
space:
mode:
Diffstat (limited to 'util/romtool/tools')
-rw-r--r--util/romtool/tools/Makefile26
-rw-r--r--util/romtool/tools/lzma/Makefile16
2 files changed, 20 insertions, 22 deletions
diff --git a/util/romtool/tools/Makefile b/util/romtool/tools/Makefile
index 1d1912a4f7..e711f500ab 100644
--- a/util/romtool/tools/Makefile
+++ b/util/romtool/tools/Makefile
@@ -1,27 +1,25 @@
+obj ?= $(shell pwd)
+
CC=gcc
-CFLAGS=-Wall -Werror -g
+CFLAGS=-Wall -W -Werror -g
-LZMA_OBJ := lzma/LZMAEncoder.o lzma/LZInWindow.o
-LZMA_OBJ += lzma/RangeCoderBit.o lzma/StreamUtils.o
-LZMA_OBJ += lzma/OutBuffer.o lzma/Alloc.o
-LZMA_OBJ += lzma/CRC.o
-LZMA_OBJ += lzma/lzma-compress.o
+all: rom-mkstage rom-mkpayload
-COMMON= common.o compress.o $(LZMA_OBJ)
+include lzma/Makefile
-all: rom-mkstage rom-mkpayload
+COMMON= common.o compress.o $(LZMA_OBJ)
-rom-mkstage: rom-mkstage.o $(COMMON)
- $(CXX) -g -o $@ rom-mkstage.o $(COMMON)
-rom-mkpayload: rom-mkpayload.o $(COMMON)
- $(CXX) -o $@ rom-mkpayload.o $(COMMON)
+$(obj)/rom-mkstage: $(obj)/rom-mkstage.o $(patsubst %,$(obj)/%,$(COMMON))
+ $(CXX) -g -o $@ $(obj)/rom-mkstage.o $(patsubst %,$(obj)/%,$(COMMON))
-include lzma/Makefile
+$(obj)/rom-mkpayload: $(obj)/rom-mkpayload.o $(patsubst %,$(obj)/%,$(COMMON))
+ $(CXX) -o $@ $(obj)/rom-mkpayload.o $(patsubst %,$(obj)/%,$(COMMON))
-%.o: %.c
+$(obj)/%.o: %.c
$(CC) -Wall -Werror -g -c -o $@ $<
clean:
@ rm -f rom-mkpayload.o rom-mkstage.o $(COMMON)
@ rm -f rom-mkpayload rom-mkstage
+
diff --git a/util/romtool/tools/lzma/Makefile b/util/romtool/tools/lzma/Makefile
index 4b6c20d08d..b012a93685 100644
--- a/util/romtool/tools/lzma/Makefile
+++ b/util/romtool/tools/lzma/Makefile
@@ -24,27 +24,27 @@ LZMA_OBJ += lzma/OutBuffer.o lzma/Alloc.o
LZMA_OBJ += lzma/CRC.o
LZMA_OBJ += lzma/lzma-compress.o
-lzma/lzma-compress.o: lzma/minilzma.cc
+$(obj)/lzma/lzma-compress.o: lzma/minilzma.cc
g++ -o $@ -c -DCOMPACT $<
-lzma/%.o: lzma/C/7zip/Compress/LZMA/%.cpp
+$(obj)/lzma/%.o: lzma/C/7zip/Compress/LZMA/%.cpp
g++ -o $@ -c $<
-lzma/%.o: lzma/C/7zip/Compress/LZ/%.cpp
+$(obj)/lzma/%.o: lzma/C/7zip/Compress/LZ/%.cpp
g++ -o $@ -c $<
-lzma/%.o: lzma/C/7zip/Compress/RangeCoder/%.cpp
+$(obj)/lzma/%.o: lzma/C/7zip/Compress/RangeCoder/%.cpp
g++ -o $@ -c $<
-lzma/%.o: lzma/C/7zip/Decompress/%.cpp
+$(obj)/lzma/%.o: lzma/C/7zip/Decompress/%.cpp
g++ -o $@ -c $<
-lzma/%.o: lzma/C/7zip/Common/%.cpp
+$(obj)/lzma/%.o: lzma/C/7zip/Common/%.cpp
g++ -o $@ -c $<
-lzma/%.o: lzma/C/Common/%.cpp
+$(obj)/lzma/%.o: lzma/C/Common/%.cpp
g++ -o $@ -c $<
-lzma/%.o: lzma/%.cc
+$(obj)/lzma/%.o: lzma/%.cc
g++ -o $@ -c $<