2013-06-05 01:56:07 +00:00
|
|
|
# HAL (de)compression tools
|
|
|
|
# copyright 2013 Devin Acker (Revenant)
|
|
|
|
# See copying.txt for legal information.
|
|
|
|
|
2015-12-15 11:16:31 +00:00
|
|
|
CFLAGS += -std=c99 -Os -Wall -s -fpic
|
2013-06-05 01:56:07 +00:00
|
|
|
# Add extension when compiling for Windows
|
|
|
|
ifdef SystemRoot
|
2013-11-12 22:07:14 +00:00
|
|
|
CC = gcc
|
2013-06-05 01:56:07 +00:00
|
|
|
EXT = .exe
|
2016-02-20 09:39:33 +00:00
|
|
|
LIBEXT = .dll
|
2013-11-12 22:07:14 +00:00
|
|
|
RM = del
|
2016-02-20 09:39:33 +00:00
|
|
|
else
|
|
|
|
LIBEXT = .so
|
2013-06-05 01:56:07 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Comment this line to suppress detailed decompression information on stdout
|
2016-02-20 09:39:33 +00:00
|
|
|
DEFINES += -DEXTRA_OUT
|
2013-06-05 01:56:07 +00:00
|
|
|
# Uncomment this line to enable debug output
|
2016-02-20 09:39:33 +00:00
|
|
|
DEFINES += -DDEBUG_OUT
|
2013-06-05 01:56:07 +00:00
|
|
|
|
2016-02-20 09:39:33 +00:00
|
|
|
all: inhal$(EXT) exhal$(EXT) libexhal$(LIBEXT) libexhal.a
|
2013-06-05 01:56:07 +00:00
|
|
|
|
|
|
|
clean:
|
2015-12-15 11:16:31 +00:00
|
|
|
$(RM) inhal$(EXT) exhal$(EXT) compress.o libexhal.so
|
2013-06-05 01:56:07 +00:00
|
|
|
|
2013-11-20 01:12:15 +00:00
|
|
|
inhal$(EXT): inhal.c compress.o
|
2013-11-12 22:07:14 +00:00
|
|
|
$(CC) $(DEFINES) $(CFLAGS) -o inhal$(EXT) inhal.c compress.o
|
2013-06-05 01:56:07 +00:00
|
|
|
|
2013-11-20 01:12:15 +00:00
|
|
|
exhal$(EXT): exhal.c compress.o
|
2013-11-12 22:07:14 +00:00
|
|
|
$(CC) $(DEFINES) $(CFLAGS) -o exhal$(EXT) exhal.c compress.o
|
2013-06-05 01:56:07 +00:00
|
|
|
|
|
|
|
compress.o: compress.c
|
2013-11-12 22:07:14 +00:00
|
|
|
$(CC) $(DEFINES) $(CFLAGS) -c compress.c
|
2015-12-15 11:16:31 +00:00
|
|
|
|
2016-02-20 09:39:33 +00:00
|
|
|
libexhal$(LIBEXT): compress.o
|
2015-12-15 11:16:31 +00:00
|
|
|
gcc -shared -o $@ $^
|
2016-02-20 09:39:33 +00:00
|
|
|
libexhal.a: compress.o
|
|
|
|
ar rcs $@ $^
|
2015-12-15 11:16:31 +00:00
|
|
|
install: all libexhal.so
|
|
|
|
mkdir -pv /usr/local/bin
|
|
|
|
cp inhal$(EXT) exhal$(EXT) /usr/local/bin
|
|
|
|
mkdir -pv /usr/local/lib
|
2016-02-20 09:39:33 +00:00
|
|
|
cp libexhal$(LIBEXT) /usr/local/lib
|
|
|
|
cp libexhal.a /usr/local/lib
|
2015-12-15 11:16:31 +00:00
|
|
|
mkdir -pv /usr/local/include
|
|
|
|
cp include/* /usr/local/include
|