old-exhal/makefile

47 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

# 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
# Add extension when compiling for Windows
ifdef SystemRoot
CC = gcc
EXT = .exe
2016-02-20 09:39:33 +00:00
LIBEXT = .dll
RM = del
2016-02-20 09:39:33 +00:00
else
LIBEXT = .so
endif
# Comment this line to suppress detailed decompression information on stdout
2016-02-20 09:39:33 +00:00
DEFINES += -DEXTRA_OUT
# Uncomment this line to enable debug output
2016-02-20 09:39:33 +00:00
DEFINES += -DDEBUG_OUT
2016-02-20 09:39:33 +00:00
all: inhal$(EXT) exhal$(EXT) libexhal$(LIBEXT) libexhal.a
clean:
2015-12-15 11:16:31 +00:00
$(RM) inhal$(EXT) exhal$(EXT) compress.o libexhal.so
2013-11-20 01:12:15 +00:00
inhal$(EXT): inhal.c compress.o
$(CC) $(DEFINES) $(CFLAGS) -o inhal$(EXT) inhal.c compress.o
2013-11-20 01:12:15 +00:00
exhal$(EXT): exhal.c compress.o
$(CC) $(DEFINES) $(CFLAGS) -o exhal$(EXT) exhal.c compress.o
compress.o: compress.c
$(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