aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorc2023-12-07 13:26:21 -0500
committerc2023-12-07 13:26:21 -0500
commit8c9b5cc46365dbe07b3bee7192338ecc3da73cd5 (patch)
treecc79b717eda80ee14a8ee627a55475acb3fa2fc2
parentf98c8330820d7d1a043d510fd46b31169dad3ac3 (diff)
Consistant use of () over {} in Makefile.
-rw-r--r--Makefile37
-rw-r--r--src/include/doer.h6
2 files changed, 25 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 0a68937..4de7e60 100644
--- a/Makefile
+++ b/Makefile
@@ -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."
diff --git a/src/include/doer.h b/src/include/doer.h
index f349749..f527114 100644
--- a/src/include/doer.h
+++ b/src/include/doer.h
@@ -9,7 +9,13 @@ typedef struct DOER {
tree_t* tree;
} doer_t;
+/* Creates a new parser. */
doer_t* doer_init(tree_t* tree);
+
+/*
+ Destroys a doer.
+ - Does not free the `tree`.
+*/
void doer_destroy(doer_t* doer);
void doer_do_blin_print(char* s);