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/" 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/ && \ mkdir -p dist/libmelonvpnshared-obj/ && \ ./scripts/gcc_multiwrap.sh -I ${libshared} -- dist/libmelonvpnshared.a dist/libmelonvpnshared-obj/ ${shared_sourcefiles} build-daemon: mkdir -p dist/ && \ gcc -o dist/melonvpndaemon -I ${libshared} ${daemon_sourcefiles} dist/libmelonvpnshared.a -pthread build-refreshpeers: mkdir -p dist/ && \ gcc -o dist/melonvpnrefreshpeers -I ${libshared} ${refreshpeers_sourcefiles} dist/libmelonvpnshared.a obj/mjson.o build-user: mkdir -p dist/ && \ make build-gui && \ make build-cli build-cli: mkdir -p dist/ && \ gcc -rdynamic -o dist/melonvpn -I ${libshared} ${cli_sourcefiles} dist/libmelonvpnshared.a -DPROJ_VERSION=\"${proj_version}\" -ldl -pthread build-gui: mkdir -p dist/ && \ gcc `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` 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/