SRC := src BUILD := .build/ CC := gcc CFLAGS := -std=gnu99 -g -Wextra -Wall -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wconversion -Wunreachable-code -pedantic -fsanitize=address -fsanitize=undefined -save-temps -Wno-builtin-declaration-mismatch CLIBS := $(SRC)/lib/*.c ADDRESS := 127.0.0.1 PORT := 42069 run: cluster.py edevice.py # -- the targets that actually get used -- edevice.py: $(BUILD)/edevice # this is the client @echo ./$^ "$(ADDRESS)" "$(PORT)" cluster.py: $(BUILD)/cluster # this is the server @echo ./$^ "$(ADDRESS)" "$(PORT)" $(BUILD)/edevice: $(BUILD) $(SRC)/edevice.c $(CC) $(CFLAGS) $(CLIBS) $(SRC)/edevice.c -o $@ $(BUILD)/cluster: $(BUILD) $(SRC)/cluster.c $(CC) $(CFLAGS) $(CLIBS) $(SRC)/cluster.c -o $@ # -- Cleanup targets -- $(BUILD): mkdir $@ .PHONY: clean clean: rm -rf $(BUILD)