blob: fe850ba0f859e0e9551f78acf2edb9eb54c8d0fc [file] [log] [blame]
Uwe Hermann7eb845e2008-11-02 17:01:06 +00001##
2## This file is part of the bayou project.
3##
4## Copyright (C) 2008 Advanced Micro Devices, Inc.
5##
6## This program is free software; you can redistribute it and/or modify
7## it under the terms of the GNU General Public License version 2 as
8## published by the Free Software Foundation.
9##
10## This program is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13## GNU General Public License for more details.
14##
15## You should have received a copy of the GNU General Public License
16## along with this program; if not, write to the Free Software
Paul Menzela46a7122013-02-23 18:37:27 +010017## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Uwe Hermann7eb845e2008-11-02 17:01:06 +000018##
19
Uwe Hermann7eb845e2008-11-02 17:01:06 +000020PBUILDOBJS := config.o create.o show.o main.o
21INCLUDES := -Iliblar/
Stefan Reinauer7b769122010-04-20 23:04:46 +000022HOSTCXX=g++
23HOSTCC=gcc
24HOSTCFLAGS=-Wall -Werror -g
Uwe Hermann7eb845e2008-11-02 17:01:06 +000025
Uwe Hermann54c52762008-11-02 17:48:20 +000026all: pbuilder
27
28LZMA_OBJ := lzma/LZMAEncoder.o lzma/LZInWindow.o lzma/RangeCoderBit.o
29LZMA_OBJ += lzma/StreamUtils.o lzma/OutBuffer.o lzma/Alloc.o lzma/CRC.o
30LZMA_OBJ += lzma/lzma-compress.o
31
32lzma/lzma-compress.o: lzma/minilzma.cc
Stefan Reinauer7b769122010-04-20 23:04:46 +000033 $(HOSTCXX) -o $@ -c -DCOMPACT $<
Uwe Hermann54c52762008-11-02 17:48:20 +000034
35lzma/%.o: lzma/C/7zip/Compress/LZMA/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000036 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000037
38lzma/%.o: lzma/C/7zip/Compress/LZ/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000039 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000040
41lzma/%.o: lzma/C/7zip/Compress/RangeCoder/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000042 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000043
44lzma/%.o: lzma/C/7zip/Decompress/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000045 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000046
47lzma/%.o: lzma/C/7zip/Common/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000048 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000049
50lzma/%.o: lzma/C/Common/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000051 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000052
53lzma/%.o: lzma/%.cc
Stefan Reinauer7b769122010-04-20 23:04:46 +000054 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000055
Uwe Hermann7eb845e2008-11-02 17:01:06 +000056pbuilder: $(PBUILDOBJS) $(LZMA_OBJ) liblar/liblar.a
Stefan Reinauer7b769122010-04-20 23:04:46 +000057 $(HOSTCXX) -o $@ $(PBUILDOBJS) $(LZMA_OBJ) liblar/liblar.a -lexpat
Uwe Hermann7eb845e2008-11-02 17:01:06 +000058
59liblar/liblar.a:
Stefan Reinauer7b769122010-04-20 23:04:46 +000060 $(MAKE) -C liblar
Uwe Hermann7eb845e2008-11-02 17:01:06 +000061
Uwe Hermann7eb845e2008-11-02 17:01:06 +000062%.o: %.c
Stefan Reinauer7b769122010-04-20 23:04:46 +000063 $(HOSTCC) -c $(HOSTCFLAGS) $(INCLUDES) -o $@ $<
Uwe Hermann7eb845e2008-11-02 17:01:06 +000064
65clean:
Uwe Hermann54c52762008-11-02 17:48:20 +000066 rm -f pbuilder *.o lzma/*.o
Stefan Reinauer7b769122010-04-20 23:04:46 +000067 $(MAKE) -C liblar clean
Uwe Hermann54c52762008-11-02 17:48:20 +000068