Files
bmoar 37a08f8eaa add strip --strip-all to decrease bin size
bin went from 18k to 15k after strip.
added -ggdb3 for additional debugging symbols
created $(NAME) for DRY
2016-01-08 21:12:14 -05:00

26 lines
573 B
Makefile

NAME=firecat
CC=gcc
#CC=clang
ifneq ($(shell which strip 2>/dev/null),)
STRIP = strip
else
STRIP = @echo "ERROR: 'strip' command not found but is required to build prod" && exit 1
endif
# With -Os, gcc makes a slightly smaller binary (18K vs 19K)
# with --strip-all binary is 15k
make:
$(CC) -Wall -Werror -ansi -pedantic -ggdb3 $(NAME).c -o $(NAME)
prod:
$(CC) -Os $(NAME).c -o $(NAME)
$(STRIP) --strip-all $(NAME)
# from http://www.bishopfox.com/resources/tools/other-free-tools/firecat/
windows:
gcc -lwsock32 -Os $(NAME).c -o $(NAME).exe
clean:
rm -f $(NAME)