2022-11-30 16:15:12 +01:00
|
|
|
include ../../config.mk
|
2022-11-30 14:40:43 +01:00
|
|
|
|
|
|
|
CFLAGS = -std=c99 -D_DEFAULT_SOURCE -Wpedantic -I../../libhashset/include $(XCFLAGS)
|
2022-11-30 16:15:12 +01:00
|
|
|
LDFLAGS = -L../../libhashset/lib -lhashset-1 $(XLDFLAGS)
|
2022-11-30 14:40:43 +01:00
|
|
|
|
|
|
|
SRC_PATH := src
|
|
|
|
BIN_PATH := bin
|
|
|
|
ALL_PATH := $(SRC_PATH) $(BIN_PATH)
|
|
|
|
|
2022-11-30 16:15:12 +01:00
|
|
|
BIN_FILE := $(BIN_PATH)/test-hash-set$(EXE_SUFFIX)
|
2022-11-30 14:40:43 +01:00
|
|
|
SRC_FILE := $(wildcard $(SRC_PATH)/*.c)
|
|
|
|
|
2022-11-30 18:03:42 +01:00
|
|
|
.PHONY: all build clean test
|
2022-11-30 14:40:43 +01:00
|
|
|
|
|
|
|
all: clean build
|
|
|
|
|
|
|
|
build: $(ALL_PATH) $(BIN_FILE)
|
|
|
|
|
2022-11-30 16:15:12 +01:00
|
|
|
$(BIN_FILE): $(SRC_FILE)
|
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
2022-11-30 14:40:43 +01:00
|
|
|
|
|
|
|
$(ALL_PATH):
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
clean:
|
2022-11-30 16:15:12 +01:00
|
|
|
rm -vf $(BIN_FILE)
|
2022-11-30 18:03:42 +01:00
|
|
|
|
|
|
|
test: build
|
|
|
|
./$(BIN_FILE)
|