Makefile 1.1 KB
Newer Older
1
CFLAGS= -Wall -Wno-missing-braces -ggdb `pkg-config --cflags criterion`
2
LDFLAGS= `pkg-config --libs criterion` -L $(OPEN62541_HOME)/lib
3 4 5
LIB_DIR=$(SRC_DIR)te
OUT_DIR=build/

6
all: test_common test_modio_i2c test_keep_alive
7 8 9 10 11 12 13 14 15 16 17

test_common: test_common.o
	@mkdir -p $(OUT_DIR)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
	@mv $@ $(OUT_DIR)

test_modio_i2c: test_modio_i2c.o
	@mkdir -p $(OUT_DIR)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
	@mv $@ $(OUT_DIR)

18 19 20 21 22
test_keep_alive: test_keep_alive.o
	@mkdir -p $(OUT_DIR)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
	@mv $@ $(OUT_DIR)

23 24 25 26

run: all 
	@${OUT_DIR}/test_common --tap=${OUT_DIR}/test_common.tap
	@${OUT_DIR}/test_modio_i2c --tap=${OUT_DIR}/test_modio_i2c.tap
27
	@${OUT_DIR}/test_keep_alive --tap=${OUT_DIR}/test_keep_alive.tap
28 29 30 31 32 33 34
	

clean:
	@rm $(OUT_DIR)test_common 2>/dev/null || true
	@rm $(OUT_DIR)test_common.tap 2>/dev/null || true
	@rm $(OUT_DIR)test_modio_i2c 2>/dev/null || true
	@rm $(OUT_DIR)test_modio_i2c.tap 2>/dev/null || true
35 36
	@rm $(OUT_DIR)test_keep_alive 2>/dev/null || true
	@rm $(OUT_DIR)test_keep_alive.tap 2>/dev/null || true
37 38 39 40
	@rm *.o 2>/dev/null || true
	

.PHONY: clean debug all