diff options
author | c | 2023-12-07 13:26:21 -0500 |
---|---|---|
committer | c | 2023-12-07 13:26:21 -0500 |
commit | 8c9b5cc46365dbe07b3bee7192338ecc3da73cd5 (patch) | |
tree | cc79b717eda80ee14a8ee627a55475acb3fa2fc2 /Makefile | |
parent | f98c8330820d7d1a043d510fd46b31169dad3ac3 (diff) |
Consistant use of () over {} in Makefile.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 37 |
1 files changed, 19 insertions, 18 deletions
@@ -3,10 +3,11 @@ PREFIX := /usr/local/bin CC := gcc REG_CFLAGS := -ansi -O3 -s DBG_CFLAGS := -ansi -Og -ggdb -pedantic -DBG_CFLAGS += -Wall -Wno-deprecated-declarations +DBG_CFLAGS += -Wall -Wextra -Wformat DBG_CFLAGS += -fsanitize=leak,address,undefined -fno-omit-frame-pointer -CFLAGS := ${REG_CFLAGS} +CFLAGS := $(REG_CFLAGS) SRCS := $(wildcard src/*.c) +SRCS := $(filter-out %doer.c,$(SRCS)) # Filter out incomplete doer for now. OBJS := $(SRCS:.c=.o) .PHONY: all reg_options dbg_options halk dbg install uninstall clean me a sandwich @@ -15,38 +16,38 @@ all: halk reg_options: @echo "HALK build options:" - @echo "CC: ${CC}" - @echo "CFLAGS: ${REG_CFLAGS}" + @echo "CC: $(CC)" + @echo "CFLAGS: $(REG_CFLAGS)" @echo dbg_options: @echo "HALK build options (dbg):" - @echo "CC: ${CC}" - @echo "CFLAGS: ${DBG_CFLAGS}" + @echo "CC: $(CC)" + @echo "CFLAGS: $(DBG_CFLAGS)" @echo -halk: reg_options ${OBJS} - ${CC} ${OBJS} ${REG_CFLAGS} -o ${BIN}.out +halk: reg_options $(OBJS) + $(CC) $(OBJS) $(REG_CFLAGS) -o $(BIN).out -dbg: CFLAGS := ${DBG_CFLAGS} -dbg: dbg_options ${OBJS} - ${CC} ${OBJS} ${DBG_CFLAGS} -o ${BIN}.out +dbg: CFLAGS := $(DBG_CFLAGS) +dbg: dbg_options $(OBJS) + $(CC) $(OBJS) $(DBG_CFLAGS) -o $(BIN).out %.o: %.c - ${CC} -c $< -o $@ + $(CC) -c $< -o $@ install: all - mkdir -p ${PREFIX} - cp -f ${BIN}.out ${PREFIX}/${BIN} - chmod 755 ${PREFIX}/${BIN} + mkdir -p $(PREFIX) + cp -f $(BIN).out $(PREFIX)/$(BIN) + chmod 755 $(PREFIX)/$(BIN) uninstall: - rm -f ${PREFIX}/${BIN} + rm -f $(PREFIX)/$(BIN) clean: - rm -f ${BIN}.out src/*.o + rm -f $(BIN).out src/*.o me a: @exit sandwich: - @[ "${USER}" = "root" ] && echo "Okay." || echo "What? Make it yourself." + @[ "$(USER)" = "root" ] && echo "Okay." || echo "What? Make it yourself." |