diff options
-rw-r--r-- | Makefile | 29 | ||||
-rw-r--r-- | README.md | 1 |
2 files changed, 22 insertions, 8 deletions
@@ -1,16 +1,29 @@ -.PHONY: all clean +CC=gcc +CFLAGS=-I. -lSDL2 +SRC:=$(shell find ./ -maxdepth 1 -type f -regex ".*\.c" -not -name "main.c") +OBJ:=$(patsubst ./%.c,build/%.o,$(SRC)) +_TESTS:=$(shell find ./tests/ -maxdepth 1 -type f -regex ".*\.c") +TESTS:=$(patsubst ./%.c,build/%,$(_TESTS)) -all: build/limox build/tests/get_domainpart - ./build/tests/get_domainpart +LIMOX=build/limox -build/limox: build - gcc main.c gui.c xmpp.c -o build/limox -lSDL2 - -build/tests/get_domainpart: build - gcc tests/get_domainpart.c xmpp.c -o build/tests/get_domainpart -I. +all: build $(OBJ) $(TESTS) $(LIMOX) + @echo "Running testsuite ..." + find build/tests -type f -exec {} \; build: mkdir -p build/tests +$(LIMOX): $(OBJ) build/main.o + $(CC) -o $@ $^ $(CFLAGS) + +build/%.o: %.c + $(CC) -c -o $@ $< $(CFLAGS) + +build/tests/%: tests/%.c + $(CC) -o $@ $< $(OBJ) $(CFLAGS) + +.PHONY: clean + clean: rm -rf build @@ -14,6 +14,7 @@ to Network Programming][4]. Install these build dependencies: +- GNU coreutils - GNU make - gcc |