refactor: move sources to src/

This commit is contained in:
2025-07-09 20:49:04 +03:00
parent c1078b5b8b
commit bb3a214f21
14 changed files with 38 additions and 31 deletions

View File

@ -4,16 +4,14 @@ on:
push: push:
branches: [ "master" ] branches: [ "master" ]
paths-ignore: paths-ignore:
- 'ISSUE_TEMPLATE/**' - '.github/**'
- 'workflows/**' - '.vscode/**'
- '.vsocde/**'
- 'docs/**' - 'docs/**'
pull_request: pull_request:
branches: [ "master" ] branches: [ "master" ]
paths-ignore: paths-ignore:
- 'ISSUE_TEMPLATE/**' - '.github/**'
- 'workflows/**' - '.vscode/**'
- '.vsocde/**'
- 'docs/**' - 'docs/**'
permissions: permissions:

View File

@ -5,12 +5,10 @@ on:
branches: [ master ] branches: [ master ]
paths: paths:
- docs/** - docs/**
- mkdocs.yml
pull_request: pull_request:
branches: [ "master" ] branches: [ "master" ]
paths: paths:
- docs/** - docs/**
- mkdocs.yml
permissions: permissions:
contents: write contents: write
@ -37,3 +35,4 @@ jobs:
- run: pip install mkdocs-material - run: pip install mkdocs-material
- run: pip install mkdocs-video - run: pip install mkdocs-video
- run: mkdocs gh-deploy --force - run: mkdocs gh-deploy --force
working-directory: ./docs

View File

@ -1,26 +1,10 @@
C_SOURCES = $(shell find ./ -type f -name '*.c') .PHONY: all build clean
C_OBJECTS = $(C_SOURCES:.c=.o)
GIT_COMMIT = $(shell git rev-parse --short HEAD) all:
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD) $(MAKE) -C src all
CWARNFLAGS = -Wno-int-conversion -Wno-incompatible-pointer-types build:
$(MAKE) -C src build
CFLAGS = -std=c17 -DGIT_COMMIT='"$(GIT_COMMIT)"' -DGIT_BRANCH='"$(GIT_BRANCH)"'
LFLAGS = -lgdi32 -lws2_32
# DBGFLAGS = -Wl,--export-all-symbols -g -O0 -ggdb3 -Wall
all: build
build: $(C_OBJECTS)
$(info Linking)
x86_64-w64-mingw32-windres bridge.rc -O coff -o bridge.res
x86_64-w64-mingw32-gcc $(C_OBJECTS) bridge.res $(LFLAGS) $(DBGFLAGS) -o build/bridge.exe
%.o: %.c
$(info Compiling $<)
x86_64-w64-mingw32-gcc $(CFLAGS) $(CWARNFLAGS) $(DBGFLAGS) -c $< -o $@
clean: clean:
rm -f $(C_OBJECTS) build/bridge.exe bridge.res $(MAKE) -C src clean

26
src/Makefile Normal file
View File

@ -0,0 +1,26 @@
C_SOURCES = $(shell find ./ -type f -name '*.c')
C_OBJECTS = $(C_SOURCES:.c=.o)
GIT_COMMIT = $(shell git rev-parse --short HEAD)
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
CWARNFLAGS = -Wno-int-conversion -Wno-incompatible-pointer-types
CFLAGS = -std=c17 -DGIT_COMMIT='"$(GIT_COMMIT)"' -DGIT_BRANCH='"$(GIT_BRANCH)"'
LFLAGS = -lgdi32 -lws2_32
# DBGFLAGS = -Wl,--export-all-symbols -g -O0 -ggdb3 -Wall
all: build
build: $(C_OBJECTS)
$(info Linking)
x86_64-w64-mingw32-windres bridge.rc -O coff -o bridge.res
x86_64-w64-mingw32-gcc $(C_OBJECTS) bridge.res $(LFLAGS) $(DBGFLAGS) -o ../build/bridge.exe
%.o: %.c
$(info Compiling $<)
x86_64-w64-mingw32-gcc $(CFLAGS) $(CWARNFLAGS) $(DBGFLAGS) -c $< -o $@
clean:
rm -f $(C_OBJECTS) ../build/bridge.exe bridge.res

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -46,7 +46,7 @@ BEGIN
END END
END END
IDR_LICENSE_TXT RCDATA "LICENSE" IDR_LICENSE_TXT RCDATA "../LICENSE"
IDI_ICON_128 ICON "bridge.ico" IDI_ICON_128 ICON "bridge.ico"

View File

View File

View File