Makefile (1171B)
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 25 ifeq ($(shell uname -m),x86_64) 26 CFLAGS+=-DUI_SSE2 27 endif 28 29 all: $(NAME) 30 31 .PHONY: clean run 32 33 clean: 34 rm -f $(OBJ) ../$(NAME) 35 36 %.o : %.c $(DEPS) 37 $(CC) $(CFLAGS) -c $< -o $@ 38 39 $(NAME): $(OBJ) 40 $(CC) $(OBJ) -o ../$@ $(LDFLAGS) 41 42 strip: $(NAME) 43 ifneq ($(DEBUG),1) 44 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) 45 endif 46 47 run: strip 48 ../$(NAME)