Makefile (1453B)
1# gbcompress makefile 2 3ifndef TARGETDIR 4TARGETDIR = /opt/gbdk 5endif 6 7ifeq ($(OS),Windows_NT) 8 BUILD_OS := Windows_NT 9else 10 BUILD_OS := $(shell uname -s) 11endif 12 13# Target older macOS version than whatever build OS is for better compatibility 14ifeq ($(BUILD_OS),Darwin) 15 export MACOSX_DEPLOYMENT_TARGET=10.10 16endif 17 18CC = $(TOOLSPREFIX)gcc 19CFLAGS = -ggdb -O -Wno-incompatible-pointer-types -DGBDKLIBDIR=\"$(TARGETDIR)\" 20OBJ = main.o gbcompress.o rlecompress.o files.o files_c_source.o 21BIN = gbcompress 22 23all: $(BIN) 24 25$(BIN): $(OBJ) 26 27clean: 28 rm -f *.o $(BIN) *~ 29 rm -f tmp.* 30 rm -f *.exe 31 32# round trip the executable through compression and de-compression as a brief test 33test: 34 rm -f tmp.cmp; rm -f tmp.dcmp 35 cp $(BIN) tmp.in; ./gbcompress -v tmp.in tmp.cmp; ./gbcompress -v -d tmp.cmp tmp.dcmp; diff -s tmp.in tmp.dcmp 36 rm -f tmp.cmp.c; rm -f tmp.dcmp.c; rm -f tmp.cmp; rm -f tmp.dcmp 37 cp $(BIN) tmp.in; ./gbcompress -v --cout --varname=some_array tmp.in tmp.cmp.c; ./gbcompress -v -d --cin tmp.cmp.c tmp.dcmp; diff -s tmp.in tmp.dcmp 38 rm tmp.* 39 rm -f tmp.cmp; rm -f tmp.dcmp 40 cp $(BIN) tmp.in; ./gbcompress --alg=rle -v tmp.in tmp.cmp; ./gbcompress --alg=rle -v -d tmp.cmp tmp.dcmp; diff -s tmp.in tmp.dcmp 41 rm -f tmp.cmp.c; rm -f tmp.dcmp.c; rm -f tmp.cmp; rm -f tmp.dcmp 42 cp $(BIN) tmp.in; ./gbcompress --alg=rle -v --cout --varname=some_array tmp.in tmp.cmp.c; ./gbcompress --alg=rle -v -d --cin tmp.cmp.c tmp.dcmp; diff -s tmp.in tmp.dcmp 43 rm tmp.*