melonvpn/Makefile

67 lines
2.0 KiB
Makefile
Raw Permalink Normal View History

2021-04-24 11:06:38 +01:00
cli_sourcefiles := $(shell find src/impl/cli/ -name *.c)
gui_sourcefiles := $(shell find src/impl/gui/ -name *.c)
daemon_sourcefiles := $(shell find src/impl/daemon/ -name *.c)
refreshpeers_sourcefiles := $(shell find src/impl/refresh-peers/ -name *.c)
shared_sourcefiles := $(shell find src/impl/shared/ -name *.c)
libshared := "src/intf/"
2021-05-04 00:13:00 +01:00
hidedep := "-Wno-deprecated-declarations"
2021-04-24 11:06:38 +01:00
proj_version := $(shell cat project.json | jq .Version -r)
main:
make build-logo && \
make build-shared && \
make build-daemon && \
make build-refreshpeers && \
make build-user
all:
make main
build-shared:
mkdir -p dist/ && \
2021-04-29 17:31:19 +01:00
mkdir -p dist/libmelonvpnshared-obj/ && \
2021-05-04 00:13:00 +01:00
./scripts/gcc_multiwrap.sh ${hidedep} -I ${libshared} -- dist/libmelonvpnshared.a dist/libmelonvpnshared-obj/ ${shared_sourcefiles}
2021-04-24 11:06:38 +01:00
build-daemon:
mkdir -p dist/ && \
2021-05-04 00:13:00 +01:00
gcc -o dist/melonvpndaemon ${hidedep} -I ${libshared} ${daemon_sourcefiles} dist/libmelonvpnshared.a -pthread
2021-04-24 11:06:38 +01:00
build-refreshpeers:
mkdir -p dist/ && \
2021-05-04 00:13:00 +01:00
gcc -o dist/melonvpnrefreshpeers ${hidedep} -I ${libshared} ${refreshpeers_sourcefiles} dist/libmelonvpnshared.a obj/mjson.o
2021-04-24 11:06:38 +01:00
build-user:
mkdir -p dist/ && \
make build-gui && \
make build-cli
build-cli:
mkdir -p dist/ && \
2021-05-04 00:13:00 +01:00
gcc -g -O0 -rdynamic -o dist/melonvpn ${hidedep} -I ${libshared} ${cli_sourcefiles} dist/libmelonvpnshared.a -DPROJ_VERSION=\"${proj_version}\" -ldl -pthread
2021-04-24 11:06:38 +01:00
build-gui:
mkdir -p dist/ && \
2021-05-04 00:13:00 +01:00
gcc ${hidedep} `pkg-config --cflags gtk+-3.0 appindicator3-0.1` -shared -fPIC -o dist/libmelonvpngui.so -I ${libshared} ${gui_sourcefiles} dist/libmelonvpnshared.a `pkg-config --libs gtk+-3.0 appindicator3-0.1`
2021-04-24 11:06:38 +01:00
build-logo:
mkdir -p dist/ && \
cp "assets/melonvpn.svg" "dist/melonvpn.svg" && \
cp "assets/statusmelonoff.png" "dist/statusmelonoff.png" && \
cp "assets/statusmelonon.png" "dist/statusmelonon.png" && \
inkscape "assets/melonvpn.svg" -o "dist/melonvpn.png" -w 128 -h 128
package:
./scripts/package-melonvpn.sh && \
./scripts/package-melonvpngui.sh
deb:
make clean && \
make all && \
make package
clean:
rm -rf dist/ && \
rm -rf package/