diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 82 |
1 files changed, 49 insertions, 33 deletions
@@ -11,70 +11,86 @@ ########################################################################################## default: all - -SHELL := /bin/sh -# ============================================ DIRS ============================================== # +# ====================================== DIRS ========================================== # C_SRCS_DIR = src A_SRCS_DIR = asm -# =========================================== FILES ============================================== # -C_SRCS = ${C_SRCS_DIR}/jo_main.c -# ------------------------------------------------------------------------------------------------ # +# ====================================== FILES ========================================= # +C_SRCS = ${C_SRCS_DIR}/jo_lowbat.c +C_SRCS += ${C_SRCS_DIR}/jo_n_speak.c +C_SRCS += ${C_SRCS_DIR}/jo_n_notify.c +# -------------------------------------------------------------------------------------- # C_OBJS = ${C_SRCS:.c=.o} -# ------------------------------------------------------------------------------------------------ # +# -------------------------------------------------------------------------------------- # A_SRCS = ${A_SRCS_DIR}/jo_f_status.asm A_SRCS += ${A_SRCS_DIR}/jo_f_percent.asm -# ------------------------------------------------------------------------------------------------ # +# -------------------------------------------------------------------------------------- # A_OBJS = ${A_SRCS:.asm=.o} -# ========================================== COMPILER ============================================ # +# ===================================== COMPILER ======================================= # CC = clang -# ------------------------------------------------------------------------------------------------ # -CFLAGS = -std=c89 +# -------------------------------------------------------------------------------------- # +CFLAGS = -std=c89 CFLAGS += -Wall CFLAGS += -Wextra +CFLAGS += -Wno-comment +CFLAGS += -Wno-long-long +CFLAGS += -Wno-c99-extensions +CFLAGS += -Wno-variadic-macros CFLAGS += -Werror CFLAGS += -pedantic CFLAGS += ${DEBUG} +# -------------------------------------------------------------------------------------- # # CFLAGS += ${OPTI} -# ------------------------------------------------------------------------------------------------ # +# -------------------------------------------------------------------------------------- # OPTI = -O2 -pipe -DEBUG = -glldb -# ------------------------------------------------------------------------------------------------ # -LINK = -lc -# ------------------------------------------------------------------------------------------------ # +# -------------------------------------------------------------------------------------- # +DEBUG = -glldb +# DEBUG += -fsanitize=address +# -------------------------------------------------------------------------------------- # +CINCS = -Isrc/ +CINCS += -I/usr/local/include +CINCS += -I/usr/local/include/glib-2.0 +CINCS += -I/usr/local/lib/glib-2.0/include +CINCS += -I/usr/local/include/gdk-pixbuf-2.0 +# -------------------------------------------------------------------------------------- # +LINK = -L/usr/local/lib +LINK += -lnotify +LINK += -lespeak +LINK += -lc +# -------------------------------------------------------------------------------------- # TARGET = lowbat -# ========================================== ASSEMBLER =========================================== # +# ===================================== ASSEMBLER ====================================== # ASM = nasm ASMFLAGS = -g -f ASMARCH = elf64 -# ============================================ UNIX ============================================== # +# ======================================= UNIX ========================================= # +SHELL := /bin/sh RM = rm -f MKDIR = mkdir -p CP = cp MV = mv SED = sed -# ============================================ RULES ============================================= # - +# ======================================= RULES ======================================== # .SUFFIXES: .asm .c .o - +.PHONY: all clean fclean re depend +# -------------------------------------------------------------------------------------- # .asm.o: ${ASM} ${ASMFLAGS} ${ASMARCH} -o ${.TARGET} ${.IMPSRC} - +# -------------------------------------------------------------------------------------- # .c.o: - ${CC} -c ${CFLAGS} -I${C_SRCS_DIR} -o ${.TARGET} ${.IMPSRC} - + ${CC} -c ${CFLAGS} ${CINCS} -o ${.TARGET} ${.IMPSRC} +# -------------------------------------------------------------------------------------- # ${TARGET}: ${A_OBJS} ${C_OBJS} - ${CC} ${CFLAGS} -I${C_SRCS_DIR} -o ${.TARGET} ${.ALLSRC} ${LINK} - + ${CC} ${CFLAGS} ${CINCS} -o ${.TARGET} ${.ALLSRC} ${LINK} +# -------------------------------------------------------------------------------------- # depend: - ${CC} -I${C_SRCS_DIR} -E -MM ${C_SRCS} > .depend + ${CC} ${CINCS} -E -MM ${C_SRCS} > .depend ${SED} 's/^/${C_SRCS_DIR}\//' .depend > .depend.tmp ${MV} .depend.tmp .depend - +# -------------------------------------------------------------------------------------- # all: depend ${TARGET} - +# -------------------------------------------------------------------------------------- # clean: ${RM} ${C_OBJS} ${A_OBJS} ${TARGET}.core .depend .depend.tmp ${TARGET} - -re: fclean all - -.PHONY: all clean fclean re depend +# -------------------------------------------------------------------------------------- # +re: clean all +# ======================================== EOF ========================================= # |