2015-10-10 19:36:21 +00:00
|
|
|
# Makefile for bunzip2 for GNO (for use with dmake)
|
|
|
|
# Based on Unix Makefile for bzip2
|
|
|
|
# Modified for GNO by Stephen Heumann
|
2015-10-10 18:28:49 +00:00
|
|
|
|
2015-10-10 19:36:21 +00:00
|
|
|
# ORCA/C 2.1.0 may need more than 8 megabytes of RAM to compile decompress.c
|
|
|
|
# with full optimization enabled. Thus, this makefile can only
|
|
|
|
# be used as is on an emulated system with 14 megabyte RAM support.
|
2015-10-10 18:28:49 +00:00
|
|
|
|
|
|
|
# To assist in cross-compiling
|
2015-10-10 19:36:21 +00:00
|
|
|
# Uncomment this if make doesn't have the $CC variable set appropriately
|
|
|
|
# CC=occ
|
|
|
|
RM=cp -p rm
|
|
|
|
|
2015-10-10 18:28:49 +00:00
|
|
|
LDFLAGS=
|
|
|
|
|
2015-10-10 19:36:21 +00:00
|
|
|
# The "-I /usr/include" shouldn't be needed but seemed to fix problems for me
|
|
|
|
CFLAGS=-a0 -w -O -I /usr/include
|
|
|
|
|
|
|
|
NOROOTFLAG=-r
|
2015-10-10 18:28:49 +00:00
|
|
|
|
|
|
|
# Where you want it installed when you do 'make install'
|
2015-10-10 19:36:21 +00:00
|
|
|
PREFIX=/usr/local
|
2015-10-10 18:28:49 +00:00
|
|
|
|
|
|
|
|
2015-10-10 19:36:21 +00:00
|
|
|
OBJS= stristr.o \
|
2015-10-10 18:28:49 +00:00
|
|
|
huffman.o \
|
|
|
|
crctable.o \
|
|
|
|
randtable.o \
|
|
|
|
decompress.o \
|
|
|
|
bzlib.o
|
|
|
|
|
2015-10-10 19:36:21 +00:00
|
|
|
all: bunzip2 bzip2recover test
|
2015-10-10 18:28:49 +00:00
|
|
|
|
2015-10-10 19:36:21 +00:00
|
|
|
bunzip2: bzip2.o $(OBJS)
|
|
|
|
$(CC) -o bunzip2 bunzip2.rez
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) bzip2.o $(OBJS) -o bunzip2
|
2015-10-10 18:28:49 +00:00
|
|
|
|
|
|
|
bzip2recover: bzip2recover.o
|
2015-10-10 19:36:21 +00:00
|
|
|
$(CC) -o bzip2recover bzip2recover.rez
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) bzip2recover.o -o bzip2recover
|
2015-10-10 18:28:49 +00:00
|
|
|
|
|
|
|
check: test
|
2015-10-10 19:36:21 +00:00
|
|
|
test: bunzip2
|
2015-10-10 18:28:49 +00:00
|
|
|
@cat words1
|
2015-10-10 19:36:21 +00:00
|
|
|
./bunzip2 -dk < sample1.bz2 > sample1.tst
|
|
|
|
./bunzip2 -dk < sample2.bz2 > sample2.tst
|
|
|
|
./bunzip2 -dks < sample3.bz2 > sample3.tst
|
|
|
|
@cat words2
|
2015-10-10 18:28:49 +00:00
|
|
|
cmp sample1.tst sample1.ref
|
|
|
|
cmp sample2.tst sample2.ref
|
|
|
|
cmp sample3.tst sample3.ref
|
|
|
|
@cat words3
|
|
|
|
|
2015-10-10 19:36:21 +00:00
|
|
|
install: bunzip2 bzip2recover test justinstall
|
|
|
|
|
|
|
|
justinstall:
|
|
|
|
# This should install bunzip2 for GNO under /usr/local
|
|
|
|
mkdir $(PREFIX)/bin >& .null
|
|
|
|
mkdir $(PREFIX)/man >& .null
|
|
|
|
mkdir $(PREFIX)/man/man1 >& .null
|
|
|
|
cp -f bunzip2 $(PREFIX)/bin/bunzip2
|
2015-10-10 18:28:49 +00:00
|
|
|
cp -f bzip2recover $(PREFIX)/bin/bzip2recover
|
2015-10-10 19:36:21 +00:00
|
|
|
cp -f bunzip2.1 $(PREFIX)/man/man1/bunzip2.1
|
|
|
|
cp -f bzip2recover.1 $(PREFIX)/man/man1/bzip2recover.1
|
|
|
|
cp -f bzcat.1 $(PREFIX)/man/man1/bzcat.1
|
|
|
|
@cat words4
|
2015-10-10 18:28:49 +00:00
|
|
|
|
|
|
|
distclean: clean
|
2015-10-10 19:36:21 +00:00
|
|
|
clean:
|
|
|
|
$(RM) -f *.o *.a *.sym *.root bunzip2 bzip2recover \
|
2015-10-10 18:28:49 +00:00
|
|
|
sample1.tst sample2.tst sample3.tst
|
|
|
|
|
2015-10-10 19:36:21 +00:00
|
|
|
stristr.o: stristr.c
|
|
|
|
$(CC) $(CFLAGS) $(NOROOTFLAG) -c stristr.c
|
|
|
|
huffman.o: huffman.c bzlib_private.h
|
|
|
|
$(CC) $(CFLAGS) $(NOROOTFLAG) -c huffman.c
|
|
|
|
crctable.o: crctable.c bzlib_private.h
|
|
|
|
$(CC) $(CFLAGS) $(NOROOTFLAG) -c crctable.c
|
|
|
|
randtable.o: randtable.c bzlib_private.h
|
|
|
|
$(CC) $(CFLAGS) $(NOROOTFLAG) -c randtable.c
|
|
|
|
decompress.o: decompress.c bzlib_private.h
|
|
|
|
$(CC) $(CFLAGS) $(NOROOTFLAG) -c decompress.c
|
|
|
|
bzlib.o: bzlib.c bzlib_private.h
|
|
|
|
$(CC) $(CFLAGS) $(NOROOTFLAG) -c bzlib.c
|
|
|
|
bzip2.o: bzip2.c bzlib.h
|
|
|
|
$(CC) $(CFLAGS) -s 2048 -C1 -c bzip2.c
|
|
|
|
# $(CC) $(CFLAGS) -C1 -D __STACK_CHECK__ -c bzip2.c
|
2015-10-10 18:28:49 +00:00
|
|
|
bzip2recover.o: bzip2recover.c
|
2015-10-10 19:36:21 +00:00
|
|
|
$(CC) $(CFLAGS) -s 1024 -c bzip2recover.c
|
|
|
|
# $(CC) $(CFLAGS) -D __STACK_CHECK__ -c bzip2recover.c
|
|
|
|
bzlib_private.h: bzlib.h
|
|
|
|
|
|
|
|
chtyp:
|
|
|
|
chtyp -l cc *.c *.h
|