lemonbar/Makefile
Ivan Kanakarakis c7cc3281a8 Makefile: use -Os instead of -O2
-Os provides -O2 minus some optimizations that would
increase size, plus optimizations that would decreaze
size, plus -Os usually takes caching into account.

    -Os Optimize for size.  -Os enables all -O2 optimizations that do not
        typically increase code size.  It also performs further optimizations
        designed to reduce code size.
2012-07-17 14:36:22 +03:00

42 lines
711 B
Makefile

CC ?= gcc
STRIP ?= strip
CFLAGS ?= -Os
LDFLAGS += -lxcb
CFDEBUG = -g3 -pedantic -Wall -Wunused-parameter -Wlong-long\
-Wsign-conversion -Wconversion -Wimplicit-function-declaration
EXEC = bar
SRCS = bar.c
OBJS = ${SRCS:.c=.o}
PREFIX?=/usr
BINDIR=${PREFIX}/bin
all: ${EXEC}
.c.o:
${CC} ${CFLAGS} -o $@ -c $<
${OBJS}: config.h
config.h:
@echo creating $@ from config.def.h
@cp config.def.h $@
${EXEC}: ${OBJS}
${CC} ${LDFLAGS} -o ${EXEC} ${OBJS}
${STRIP} -s ${EXEC}
debug: ${EXEC}
debug: CC += ${CFDEBUG}
clean:
rm -rf ./*.o
rm -rf ./${EXEC}
install: bar
test -d ${DESTDIR}${BINDIR} || mkdir -p ${DESTDIR}${BINDIR}
install -m755 bar ${DESTDIR}${BINDIR}/bar
.PHONY: all debug clean install