Makefile (1331B)
1 NAME:=emote2ss_gui 2 SRC:=$(wildcard *.c) 3 DEPS:=$(wildcard ../include/*.h) 4 OBJ:=$(SRC:.c=.o) 5 LIBS:=libwebp libwebpdemux 6 ifeq ($(OS),Windows_NT) 7 $(info OS is $(OS)) 8 else 9 LIBS+=x11 10 endif 11 CFLAGS=-std=c99 -ffast-math -fno-stack-protector -fomit-frame-pointer -fwrapv -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables -fno-unwind-tables -fmerge-all-constants -fno-ident -march=native -I. -I../include/ ${shell pkg-config --cflags $(LIBS)} 12 ifeq ($(DEBUG),1) 13 CFLAGS+=-O0 -g 14 else 15 CFLAGS+=-Os -s 16 endif 17 LDFLAGS=-lc -lm -Wl,--gc-sections ${shell pkg-config --libs $(LIBS)} 18 ifeq ($(OS),Windows_NT) 19 CFLAGS+=-DUI_WINDOWS 20 LDFLAGS+=-lgdi32 -luser32 -lshell32 21 else 22 CFLAGS+=-DUI_LINUX 23 endif 24 UPX_FOUND:=$(shell command -v upx 2>/dev/null) 25 26 all: $(NAME) 27 28 .PHONY: clean run 29 30 clean: 31 rm -f $(OBJ) ../$(NAME) 32 33 %.o : %.c $(DEPS) 34 $(CC) $(CFLAGS) -c $< -o $@ 35 36 $(NAME): $(OBJ) 37 $(CC) $(OBJ) -o ../$@ $(LDFLAGS) 38 39 strip: $(NAME) 40 ifneq ($(DEBUG),1) 41 strip -S --strip-unneeded --remove-section=.note.gnu.gold-version --remove-section=.comment --remove-section=.note --remove-section=.note.gnu.build-id --remove-section=.note.ABI-tag ../$(NAME) 42 endif 43 44 upx: strip 45 ifdef UPX_FOUND 46 ifneq ($(DEBUG),1) 47 upx --ultra-brute ../$(NAME) 48 endif 49 else 50 @echo "upx is not installed" 51 endif 52 @echo -ne "file size: " 53 @stat -c%s ../$(NAME) 54 55 run: upx 56 ../$(NAME)