2022-11-30 16:41:14 +01:00
|
|
|
include ../../config.mk
|
|
|
|
|
2022-12-03 14:50:12 +01:00
|
|
|
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wall -Wpedantic -I../../libhashset/include -I../shared/include $(XCFLAGS)
|
2022-11-30 16:41:14 +01:00
|
|
|
LDFLAGS = -L../../libhashset/lib -lhashset-1 $(XLDFLAGS)
|
|
|
|
|
|
|
|
SRC_PATH := src
|
|
|
|
BIN_PATH := bin
|
|
|
|
ALL_PATH := $(SRC_PATH) $(BIN_PATH)
|
|
|
|
|
2022-12-01 16:41:08 +01:00
|
|
|
BIN_FILE := $(BIN_PATH)/test-hash-map$(EXE_SUFFIX)
|
|
|
|
SRC_FILE := $(wildcard $(SRC_PATH)/*.c) $(wildcard ../shared/src/*.c)
|
2022-11-30 16:41:14 +01:00
|
|
|
|
2022-11-30 21:04:36 +01:00
|
|
|
.PHONY: all clean test
|
2022-11-30 16:41:14 +01:00
|
|
|
|
2022-11-30 21:04:36 +01:00
|
|
|
all: clean $(ALL_PATH) $(BIN_FILE)
|
2022-11-30 16:41:14 +01:00
|
|
|
|
|
|
|
$(BIN_FILE): $(SRC_FILE)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
$(ALL_PATH):
|
|
|
|
mkdir -p $@
|
|
|
|
|
2022-11-30 21:04:36 +01:00
|
|
|
test: all
|
2022-12-05 15:03:31 +01:00
|
|
|
env $(ENV_LDPATH)="$(realpath .):$(realpath ../../libhashset/lib)$(if $($(ENV_LDPATH)),:$($(ENV_LDPATH)))" ./$(BIN_FILE)
|
2022-11-30 21:04:36 +01:00
|
|
|
|
2022-11-30 16:41:14 +01:00
|
|
|
clean:
|
|
|
|
rm -vf $(BIN_FILE)
|