-
-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from lakinduakash/dev
Transfer build system from cmake to make
- Loading branch information
Showing
14 changed files
with
165 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build | ||
.idea | ||
.vscode | ||
src/cmake-build-debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
all: | ||
@echo "Run 'make install' for installation." | ||
@echo "Run 'make uninstall' for uninstallation." | ||
mkdir -p build | ||
cd build && cmake -G "CodeBlocks - Unix Makefiles" ../src | ||
@echo "Run 'sudo make install' for installation." | ||
@echo "Run 'sudo make uninstall' for uninstallation." | ||
cd src && $(MAKE) | ||
|
||
install: | ||
@echo "Installing" | ||
cd build && cmake -DCMAKE_INSTALL_PREFIX=$(DESTDIR) -G "CodeBlocks - Unix Makefiles" ../src | ||
$(MAKE) -C src/scripts install | ||
$(MAKE) -C build install_build | ||
@echo "Installing..." | ||
cd src && $(MAKE) install | ||
|
||
uninstall: | ||
$(MAKE) -C src/scripts uninstall | ||
$(MAKE) -C build uninstall_build | ||
@echo "Uninstalling..." | ||
cd src && $(MAKE) uninstall | ||
|
||
clean-old: | ||
cd src && $(MAKE) clean-old | ||
|
||
.PHONY: clean | ||
|
||
clean: | ||
cd src && $(MAKE) clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
all: | ||
@echo "Run 'make install' for installation." | ||
@echo "Run 'make uninstall' for uninstallation." | ||
mkdir -p build | ||
cd build && cmake -G "CodeBlocks - Unix Makefiles" ../src | ||
|
||
install: | ||
@echo "Installing" | ||
cd build && cmake -DCMAKE_INSTALL_PREFIX=$(DESTDIR) -G "CodeBlocks - Unix Makefiles" ../src | ||
$(MAKE) -C src/scripts install | ||
$(MAKE) -C build install_build | ||
|
||
uninstall: | ||
$(MAKE) -C src/scripts uninstall | ||
$(MAKE) -C build uninstall_build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
CC=gcc | ||
PKGCONFIG = $(shell which pkg-config) | ||
|
||
CFLAGS=`pkg-config --cflags gtk+-3.0` | ||
LIBS=`pkg-config --libs gtk+-3.0 --libs x11` -lstdc++ | ||
|
||
APP_NAME="wihotspot" | ||
APP_GUI_BINARY="wihotspot-gui" | ||
|
||
PREFIX=/usr | ||
BINDIR=$(PREFIX)/bin | ||
APP_DIR=$(PREFIX)/share/$(APP_NAME) | ||
|
||
ODIR=../build | ||
|
||
GLIB_COMPILE_RESOURCES = $(shell $(PKGCONFIG) --variable=glib_compile_resources gio-2.0) | ||
|
||
BUILT_SRC = resources.c | ||
|
||
_OBJ = main.o ui.o h_prop.o util.o read_config.o $(BUILT_SRC:.c=.o) | ||
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ)) | ||
|
||
all: resources.c $(ODIR)/wihotspot-gui | ||
|
||
resources.c: ui/glade/wifih.gresource.xml ui/glade/wifih.ui | ||
$(GLIB_COMPILE_RESOURCES) ui/glade/wifih.gresource.xml --target=ui/$@ --sourcedir=ui/glade --generate-source | ||
|
||
$(ODIR)/%.o: ui/%.c | ||
$(CC) -c -o $@ $< $(CFLAGS) | ||
|
||
$(ODIR)/%.o: ui/%.cpp | ||
g++ -c -o $@ $< | ||
|
||
$(ODIR)/wihotspot-gui: $(OBJ) | ||
$(CC) -o $@ $^ $(CFLAGS) $(LIBS) | ||
|
||
install: $(ODIR)/wihotspot-gui | ||
mkdir -p $(DESTDIR)$(APP_DIR) | ||
install -Dm644 desktop/hotspot.png $(DESTDIR)$(APP_DIR)/hotspot.png | ||
install -Dm644 desktop/wifihotspot.desktop $(DESTDIR)$(APP_DIR)/$(APP_NAME).desktop | ||
install -Dm644 desktop/wifihotspot.desktop $(DESTDIR)$(PREFIX)/share/applications/$(APP_NAME).desktop | ||
install -Dm755 $(ODIR)/wihotspot-gui $(DESTDIR)$(BINDIR)/$(APP_GUI_BINARY) | ||
cd scripts && $(MAKE) install | ||
|
||
uninstall: | ||
rm -rf $(DESTDIR)$(APP_DIR) | ||
rm -f $(DESTDIR)$(PREFIX)/share/applications/$(APP_NAME).desktop | ||
rm -f $(DESTDIR)$(BINDIR)/$(APP_GUI_BINARY) | ||
cd scripts && $(MAKE) uninstall | ||
|
||
clean-old: | ||
rm -rf $(DESTDIR)/usr/share/wihotspot_gui | ||
rm -rf $(DESTDIR)/usr/share/wihotspot | ||
rm -f $(DESTDIR)/usr/bin/wihotspot_gui | ||
rm -f $(DESTDIR)/usr/bin/wihotspot | ||
|
||
.PHONY: clean | ||
|
||
clean: | ||
rm -f $(ODIR)/*.o | ||
rm -f ui/$(BUILT_SRC) | ||
rm -f $(ODIR)/wihotspot-gui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
|
||
# Start wihotspot_gui as root user | ||
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /usr/bin/wihotspot_gui | ||
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY /usr/bin/wihotspot-gui |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<gresources> | ||
<gresource prefix="/org/gtk/wihotspot"> | ||
<file preprocess="xml-stripblanks">wifih.ui</file> | ||
</gresource> | ||
<gresource prefix="/css"> | ||
<file>style.css</file> | ||
</gresource> | ||
</gresources> |
Oops, something went wrong.