1 | CPP := g++ |
---|
2 | CC := gcc |
---|
3 | OBJ := main.o UnAlz.o UnAlzUtils.o UnAlzBz2decompress.o UnAlzBzip2.o UnAlzbzlib.o zlib/adler32.o zlib/crc32.o zlib/infback.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/zutil.o bzip2/blocksort.o bzip2/compress.o bzip2/crctable.o bzip2/huffman.o bzip2/randtable.o |
---|
4 | BIN := unalz |
---|
5 | LDFLAGS += -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64 |
---|
6 | CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64-Os -arch x86_64 |
---|
7 | CXXFLAGS=-Os -stdlib=libc++ -arch x86_64 |
---|
8 | CXXFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 |
---|
9 | |
---|
10 | all: |
---|
11 | @echo "" |
---|
12 | @echo "USAGE : make TARGET_SYSTEM" |
---|
13 | @echo "" |
---|
14 | @echo "" |
---|
15 | @echo "TARGET_SYSTEM is one of" |
---|
16 | @echo "" |
---|
17 | @echo " posix-utf8 : POSIX with utf8 filesystem(Most of modern OS, e.g. OSX/Ubuntu)" |
---|
18 | |
---|
19 | @echo " posix : POSIX system (FreeBSD/linux/OSX/sparc/Win32)" |
---|
20 | @echo " linux-utf8 : LINUX with utf8 filesystem(without -liconv option)" |
---|
21 | @echo " posix-noiconv : POSIX without libiconv (Windows(MINGW32,CYGWIN) or EUC-KR file system)" |
---|
22 | @echo "" |
---|
23 | @echo " 'install' for copy unalz to /usr/local/bin and " |
---|
24 | @echo " 'clean' for clean" |
---|
25 | @echo "" |
---|
26 | |
---|
27 | posix: unalz |
---|
28 | $(CPP) -c UnAlz.cpp -c UnAlzUtils.cpp -c main.cpp -D_UNALZ_ICONV $(CXXFLAGS) |
---|
29 | $(CPP) $(OBJ) $(LDFLAGS) -liconv -o $(BIN) |
---|
30 | |
---|
31 | posix-utf8: unalz |
---|
32 | $(CPP) -c UnAlz.cpp -c UnAlzUtils.cpp -c main.cpp -D_UNALZ_ICONV -D_UNALZ_UTF8 $(CXXFLAGS) |
---|
33 | $(CPP) $(OBJ) $(LDFLAGS) -liconv -o $(BIN) |
---|
34 | |
---|
35 | posix-noiconv: unalz |
---|
36 | $(CPP) -c UnAlz.cpp -c UnAlzUtils.cpp -c main.cpp $(CXXFLAGS) |
---|
37 | $(CPP) $(OBJ) $(LDFLAGS) -o $(BIN) |
---|
38 | |
---|
39 | linux-utf8: unalz |
---|
40 | $(CPP) -c UnAlz.cpp -c UnAlzUtils.cpp -c main.cpp -D_UNALZ_ICONV -D_UNALZ_UTF8 $(CXXFLAGS) |
---|
41 | $(CPP) $(OBJ) $(LDFLAGS) -o $(BIN) |
---|
42 | |
---|
43 | install: |
---|
44 | cp unalz /usr/local/bin/ |
---|
45 | |
---|
46 | clean: |
---|
47 | rm -f $(OBJ) $(BIN) |
---|
48 | |
---|
49 | $(BIN): $(OBJ) |
---|
50 | |
---|
51 | |
---|
52 | zlib/adler32.o: zlib/adler32.c |
---|
53 | $(CC) -c zlib/adler32.c -o zlib/adler32.o $(CFLAGS) |
---|
54 | |
---|
55 | zlib/crc32.o: zlib/crc32.c |
---|
56 | $(CC) -c zlib/crc32.c -o zlib/crc32.o $(CFLAGS) |
---|
57 | |
---|
58 | zlib/infback.o: zlib/infback.c |
---|
59 | $(CC) -c zlib/infback.c -o zlib/infback.o $(CFLAGS) |
---|
60 | |
---|
61 | zlib/inffast.o: zlib/inffast.c |
---|
62 | $(CC) -c zlib/inffast.c -o zlib/inffast.o $(CFLAGS) |
---|
63 | |
---|
64 | zlib/inflate.o: zlib/inflate.c |
---|
65 | $(CC) -c zlib/inflate.c -o zlib/inflate.o $(CFLAGS) |
---|
66 | |
---|
67 | zlib/inftrees.o: zlib/inftrees.c |
---|
68 | $(CC) -c zlib/inftrees.c -o zlib/inftrees.o $(CFLAGS) |
---|
69 | |
---|
70 | zlib/zutil.o: zlib/zutil.c |
---|
71 | $(CC) -c zlib/zutil.c -o zlib/zutil.o $(CFLAGS) |
---|
72 | |
---|
73 | bzip2/blocksort.o: bzip2/blocksort.c |
---|
74 | $(CC) -c bzip2/blocksort.c -o bzip2/blocksort.o $(CFLAGS) |
---|
75 | |
---|
76 | bzip2/compress.o: bzip2/compress.c |
---|
77 | $(CC) -c bzip2/compress.c -o bzip2/compress.o $(CFLAGS) |
---|
78 | |
---|
79 | bzip2/crctable.o: bzip2/crctable.c |
---|
80 | $(CC) -c bzip2/crctable.c -o bzip2/crctable.o $(CFLAGS) |
---|
81 | |
---|
82 | bzip2/huffman.o: bzip2/huffman.c |
---|
83 | $(CC) -c bzip2/huffman.c -o bzip2/huffman.o $(CFLAGS) |
---|
84 | |
---|
85 | bzip2/randtable.o: bzip2/randtable.c |
---|
86 | $(CC) -c bzip2/randtable.c -o bzip2/randtable.o $(CFLAGS) |
---|
87 | |
---|