Commit 857e7c75 authored by John Hodge's avatar John Hodge
Browse files

Makefile - Clean up makefiles

parent 45bee621
.PHONY: all clean install
SUBMAKE := make --no-print-directory
all:
@make -C cokebank_sqlite all
# @make -C cokebank_basic all
@make -C server all
@make -C client all
@echo "--- cokebank_sqlite: all" && $(SUBMAKE) -C cokebank_sqlite all
# @echo "--- cokebank_basic: all" && $(SUBMAKE) -C cokebank_basic all
@echo "--- server: all" && $(SUBMAKE) -C server all
@echo "--- client: all" && $(SUBMAKE) -C client all
clean:
@make -C cokebank_sqlite clean
# @make -C cokebank_basic clean
@make -C server clean
@make -C client clean
@echo "--- cokebank_sqlite: clean" && $(SUBMAKE) -C cokebank_sqlite clean
# @echo "--- cokebank_basic: clean" && $(SUBMAKE) -C cokebank_basic clean
@echo "--- server: clean" && $(SUBMAKE) -C server clean
@echo "--- client: clean" && $(SUBMAKE) -C client clean
install:
@make -C server install
@make -C client install
@echo "--- server: install" && $(SUBMAKE) -C server install
@echo "--- client: install" && $(SUBMAKE) -C client install
# OpenDispense 2
#
V ?= @
INSTALLDIR := /usr/local/opendispense2
CFLAGS := -Wall -Werror -g -std=gnu99
......@@ -10,6 +11,9 @@ BIN := ../../dispense
OBJ := main.o protocol.o menu.o
OBJ += doregex.o config.o
OBJ := $(patsubst %,.obj/%,$(OBJ))
DEPFILES := $(OBJ:%.o=%.d)
.PHONY: all clean
......@@ -24,16 +28,18 @@ install: $(BIN)
cp $(BIN) $(INSTALLDIR)
$(BIN): $(OBJ)
$(CC) -o $(BIN) $(OBJ) $(LDFLAGS)
# chown root $(BIN)
# chmod u+s $(BIN)
%.o: %.c
$(CC) -c $< -o [email protected] $(CFLAGS) $(CPPFLAGS)
$(CC) -M -MT [email protected] -o $*.d $< $(CPPFLAGS)
%.o: ../common/%.c
$(CC) -c $< -o [email protected] $(CFLAGS) $(CPPFLAGS)
$(CC) -M -MT [email protected] -o $*.d $< $(CPPFLAGS)
@echo "[CC] -o [email protected]"
$V$(CC) -o $(BIN) $(OBJ) $(LDFLAGS)
# chown root $(BIN) && chmod u+s $(BIN)
.obj/%.o: %.c
@echo "[CC] -c $<"
@mkdir -p $(dir [email protected])
$V$(CC) -c $< -o [email protected] $(CFLAGS) $(CPPFLAGS) -MMD -MF [email protected].d
.obj/%.o: ../common/%.c
@echo "[CC] -c $<"
@mkdir -p $(dir [email protected])
$V$(CC) -c $< -o [email protected] $(CFLAGS) $(CPPFLAGS) -MMD -MF [email protected].d
-include $(DEPFILES)
# OpenDispense 2
#
V ?= @
INSTALLDIR := /usr/local/opendispense2
......@@ -28,18 +29,19 @@ install: $(BIN)
cp $(BIN) $(INSTALLDIR)
$(BIN): $(OBJ)
$(CC) -o $(BIN) $(OBJ) $(LINKFLAGS)
@echo "[CC] -o [email protected]"
@$(CC) -o $(BIN) $(OBJ) $(LINKFLAGS)
obj/%.o: %.c
@mkdir -p $(dir [email protected])
$(CC) -c $< -o [email protected] $(CFLAGS) $(CPPFLAGS)
@cpp $< -MM -MF [email protected].d
@echo "[CC] -c $<"
$V$(CC) -c $< -o [email protected] $(CFLAGS) $(CPPFLAGS) -MMD -MF [email protected].d
obj/%.o: ../common/%.c
@mkdir -p $(dir [email protected])
$(CC) -c $< -o [email protected] $(CFLAGS) $(CPPFLAGS)
@cpp $< -MM -MF [email protected].d
@echo "[CC] -c $<"
$V$(CC) -c $< -o [email protected] $(CFLAGS) $(CPPFLAGS) -MMD -MF [email protected].d
-include $(DEPFILES)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment