Skip to content

Commit 7062932

Browse files
committed
Update gcov build for modern GCC
1 parent 194cfe2 commit 7062932

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- name: Coverage
3131
if: runner.os == 'Linux'
32-
run: gcov src/uuid.c
32+
run: gcov -o dist src/uuid.c
3333

3434
- name: Upload coverage
3535
if: runner.os == 'Linux'

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
*.pyc
2-
.cache
1+
*.gcov
32
.pytest_cache/
4-
.tox/
5-
__pycache__
6-
build/
73
dist/

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,25 @@ CFLAGS += -DUSE_DEFAULT_ENTRY_POINT
3232
endif
3333

3434
ifneq ($(DEBUG),)
35-
CFLAGS += --coverage
35+
CFLAGS += --coverage
36+
LDFLAGS += --coverage
3637
endif
3738

3839
all: $(LIB)
3940

4041
clean:
4142
$(RM) -r $(DIST_DIR)
42-
$(RM) *.gcda *.gcno *.gcov
43+
$(RM) *.gcov
4344

4445
print-%:
4546
@echo '$*=$($*)'
4647

4748
test: $(LIB)
4849
uv run --group test pytest --verbose --extension=$(LIB)
4950

50-
$(LIB): $(SOURCES)
51+
$(LIB): $(DIST_DIR)/uuid.o
52+
$(CC) $< $(LDFLAGS) -o $@
53+
54+
$(DIST_DIR)/uuid.o: $(SOURCES)
5155
mkdir -p $(DIST_DIR)
52-
$(CC) $< $(CFLAGS) $(LDFLAGS) -o $@
56+
$(CC) -c $(CFLAGS) $< -o $@

0 commit comments

Comments
 (0)