Skip to content

Commit 513d26f

Browse files
committed
Move the source into the src directory
1 parent 37e315d commit 513d26f

21 files changed

Lines changed: 47 additions & 46 deletions

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
valac
2626
2727
- name: Build
28-
run: make
28+
run: |
29+
make clean
30+
make
2931
3032
build-meson:
3133
runs-on: ubuntu-24.04
@@ -50,5 +52,6 @@ jobs:
5052
5153
- name: Build with Meson
5254
run: |
55+
rm -rf build-meson
5356
meson setup build-meson
5457
meson compile -C build-meson

.gitignore

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
build
2-
build-*
3-
valabind
1+
/build/
2+
/build-*/
3+
/config.mk
4+
/Test.gir
5+
/valabind
6+
/valabind.exe
7+
/valabind.dSYM/
8+
/vstest.py
9+
/t/gir/Test.gir
10+
/t/vala/vstest.c
11+
/t/vala/vstest.h
12+
/t/vala/vstest.py
13+
/t/vala/vstest.vapi

Makefile

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ _VERSION=?
22
-include config.mk
33

44
PWD:=$(shell pwd)
5+
SRCDIR?=src
56
#GIT_TIP=$(shell [ -d .git ] && git log HEAD^..HEAD 2>/dev/null |head -n1|cut -d ' ' -f2)
67
GIT_TIP=$(shell git describe --tags)
78
DESTDIR?=
@@ -14,14 +15,12 @@ RTLIBS=gobject-2.0 glib-2.0
1415
VALAPKG:=lib$(shell ./getvv)
1516
BUILD?=build
1617
BIN=valabind
17-
SRC=config.vala main.vala valabindwriter.vala nodeffiwriter.vala utils.vala
18-
SRC+=girwriter.vala swigwriter.vala cxxwriter.vala ctypeswriter.vala dlangwriter.vala gowriter.vala
19-
SRC+=vlangwriter.vala
20-
VAPIS:=$(SRC:%.vala=$(BUILD)/%.vapi)
21-
CSRC:=$(SRC:%.vala=$(BUILD)/%.c)
22-
VALA_FILTER=$(filter %.vala,$?)
23-
TEMPS=$(addprefix --use-fast-vapi=,$(filter-out $(VALA_FILTER:%.vala=$(BUILD)/%.vapi),$(VAPIS)))
24-
TEMPS+=$(VALA_FILTER) $(patsubst %.vala,$(BUILD)/%.c,$(filter-out $?,$^))
18+
GENERATED_SRC=$(BUILD)/config.vala
19+
VALA_SRCS=main.vala valabindwriter.vala nodeffiwriter.vala utils.vala
20+
VALA_SRCS+=girwriter.vala swigwriter.vala cxxwriter.vala ctypeswriter.vala dlangwriter.vala gowriter.vala
21+
VALA_SRCS+=vlangwriter.vala
22+
SRC:=$(GENERATED_SRC) $(addprefix $(SRCDIR)/,$(VALA_SRCS))
23+
CSRC:=$(VALA_SRCS:%.vala=%.c)
2524

2625
ifneq ($(GIT_TIP),)
2726
SGIT_TIP=$(shell echo ${GIT_TIP} | sed -e s,${_VERSION},,)
@@ -77,23 +76,15 @@ endif
7776
w32:
7877
$(MAKE) W32=1
7978

80-
.PRECIOUS: $(BUILD)/%.c $(BUILD)/%.vapi
81-
$(BIN).exe: $(SRC) | $(VAPIS)
82-
@echo 'Compiling $(VALA_FILTER) -> $@'
83-
$(VALAC) --vapidir=. -D W32 -X "${CFLAGS}" -X "${LDFLAGS}" -o $@ --pkg $(VALAPKG) --save-temps ${TEMPS} windows.c --pkg windows
84-
@mv $(VALA_FILTER:%.vala=%.c) $(BUILD)
79+
$(BIN).exe: $(SRC) $(SRCDIR)/windows.c $(SRCDIR)/windows.vapi
80+
@echo 'Compiling $@'
81+
$(VALAC) --vapidir=$(SRCDIR) -D W32 -X "${CFLAGS}" -X "${LDFLAGS}" -o $@ --pkg $(VALAPKG) $(SRC) $(SRCDIR)/windows.c --pkg windows
8582

86-
$(BIN): $(SRC) | $(VAPIS)
87-
@echo 'Compiling $(VALA_FILTER) -> $@'
88-
$(VALAC) -o $@ --pkg posix $(VALA_PRIVATE_CODEGEN) --save-temps ${TEMPS}
89-
@mv $(VALA_FILTER:%.vala=%.c) $(BUILD)
83+
$(BIN): $(SRC)
84+
@echo 'Compiling $@'
85+
$(VALAC) -o $@ --pkg posix $(VALA_PRIVATE_CODEGEN) $(SRC)
9086

91-
$(BUILD)/%.vapi: %.vala | $(BUILD)
92-
@echo 'Generating $< -> $@'
93-
@$(VALAC) $(VALAFLAGS) --fast-vapi=$@ $<
94-
@${MAKE} config.vala
95-
96-
config.vala: Makefile
87+
$(GENERATED_SRC): Makefile | $(BUILD)
9788
@echo 'Generating $@'
9889
@echo 'const string version_string = "$(VERSION)";' > $@
9990

@@ -123,13 +114,11 @@ dist:
123114
shot:
124115
rm -rf valabind-$(VERSION)
125116
git clone . valabind-$(VERSION)
126-
cd valabind-$(VERSION) && $(MAKE) config.vala
127117
rm -rf valabind-$(VERSION)/.git
128118
tar czvf valabind-$(VERSION).tar.gz valabind-$(VERSION)
129119

130120
mrproper clean:
131-
rm -f config.vala
132-
rm -rf $(BUILD) $(BIN)
121+
rm -rf $(BUILD) $(BIN) $(BIN).exe
133122
rm -rf $(CSRC)
134123

135124
deinstall: uninstall

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ patches, ideas, bug reports, etc..
3535

3636
## Contact
3737

38-
* e-mail: pancake@nopcode.org
39-
* fedi: @pancake@infosec.exchange
38+
* mail: [pancake@nopcode.org](mailto:pancake@nopcode.org)
39+
* fedi: [@pancake@infosec.exchange](https://infosec.exchange/@pancake)
4040

4141
[1] http://live.gnome.org/Vala
4242
[2] http://www.swig.org

config.vala

Lines changed: 0 additions & 1 deletion
This file was deleted.

meson.build

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ project('valabind', 'c', 'vala',
44
).stdout().strip().split(' ')[1])
55

66
sources = files(
7-
'ctypeswriter.vala',
8-
'cxxwriter.vala',
9-
'dlangwriter.vala',
10-
'vlangwriter.vala',
11-
'girwriter.vala',
12-
'gowriter.vala',
13-
'nodeffiwriter.vala',
14-
'swigwriter.vala',
15-
'utils.vala',
16-
'valabindwriter.vala',
17-
'main.vala',
7+
'src/ctypeswriter.vala',
8+
'src/cxxwriter.vala',
9+
'src/dlangwriter.vala',
10+
'src/vlangwriter.vala',
11+
'src/girwriter.vala',
12+
'src/gowriter.vala',
13+
'src/nodeffiwriter.vala',
14+
'src/swigwriter.vala',
15+
'src/utils.vala',
16+
'src/valabindwriter.vala',
17+
'src/main.vala',
1818
)
1919

2020
cc = meson.get_compiler('c')
@@ -51,7 +51,7 @@ config_data = configuration_data()
5151
config_data.set_quoted('VERSION_STRING', meson.project_version())
5252

5353
config_vala = configure_file(
54-
input: 'config.vala.in',
54+
input: 'src/config.vala.in',
5555
output: 'config.vala',
5656
configuration: config_data,
5757
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)