blob: b1e56ceebc5673405a996981bbb13ae41ca4b9d2 [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##
Uwe Hermann7eb845e2008-11-02 17:01:06 +000015
Uwe Hermann7eb845e2008-11-02 17:01:06 +000016PBUILDOBJS := config.o create.o show.o main.o
17INCLUDES := -Iliblar/
Stefan Reinauer7b769122010-04-20 23:04:46 +000018HOSTCXX=g++
19HOSTCC=gcc
20HOSTCFLAGS=-Wall -Werror -g
Uwe Hermann7eb845e2008-11-02 17:01:06 +000021
Uwe Hermann54c52762008-11-02 17:48:20 +000022all: pbuilder
23
24LZMA_OBJ := lzma/LZMAEncoder.o lzma/LZInWindow.o lzma/RangeCoderBit.o
25LZMA_OBJ += lzma/StreamUtils.o lzma/OutBuffer.o lzma/Alloc.o lzma/CRC.o
26LZMA_OBJ += lzma/lzma-compress.o
27
28lzma/lzma-compress.o: lzma/minilzma.cc
Stefan Reinauer7b769122010-04-20 23:04:46 +000029 $(HOSTCXX) -o $@ -c -DCOMPACT $<
Uwe Hermann54c52762008-11-02 17:48:20 +000030
31lzma/%.o: lzma/C/7zip/Compress/LZMA/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000032 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000033
34lzma/%.o: lzma/C/7zip/Compress/LZ/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000035 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000036
37lzma/%.o: lzma/C/7zip/Compress/RangeCoder/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000038 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000039
40lzma/%.o: lzma/C/7zip/Decompress/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000041 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000042
43lzma/%.o: lzma/C/7zip/Common/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000044 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000045
46lzma/%.o: lzma/C/Common/%.cpp
Stefan Reinauer7b769122010-04-20 23:04:46 +000047 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000048
49lzma/%.o: lzma/%.cc
Stefan Reinauer7b769122010-04-20 23:04:46 +000050 $(HOSTCXX) -o $@ -c $<
Uwe Hermann54c52762008-11-02 17:48:20 +000051
Uwe Hermann7eb845e2008-11-02 17:01:06 +000052pbuilder: $(PBUILDOBJS) $(LZMA_OBJ) liblar/liblar.a
Stefan Reinauer7b769122010-04-20 23:04:46 +000053 $(HOSTCXX) -o $@ $(PBUILDOBJS) $(LZMA_OBJ) liblar/liblar.a -lexpat
Uwe Hermann7eb845e2008-11-02 17:01:06 +000054
55liblar/liblar.a:
Stefan Reinauer7b769122010-04-20 23:04:46 +000056 $(MAKE) -C liblar
Uwe Hermann7eb845e2008-11-02 17:01:06 +000057
Uwe Hermann7eb845e2008-11-02 17:01:06 +000058%.o: %.c
Stefan Reinauer7b769122010-04-20 23:04:46 +000059 $(HOSTCC) -c $(HOSTCFLAGS) $(INCLUDES) -o $@ $<
Uwe Hermann7eb845e2008-11-02 17:01:06 +000060
61clean:
Uwe Hermann54c52762008-11-02 17:48:20 +000062 rm -f pbuilder *.o lzma/*.o
Stefan Reinauer7b769122010-04-20 23:04:46 +000063 $(MAKE) -C liblar clean