Skip to content

Commit

Permalink
Add install to make
Browse files Browse the repository at this point in the history
  • Loading branch information
t.booker committed Sep 16, 2020
1 parent ee5d18f commit fd38c7a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
25 changes: 19 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ GTKLIB=`pkg-config --cflags --libs gtk+-3.0`
LD=gcc
LDFLAGS=$(PTHREAD) $(GTKLIB) -export-dynamic

OBJS= main.o
all: build


all: $(OBJS)
$(LD) -o $(TARGET) $(OBJS) $(LDFLAGS)
build: main.o
$(LD) -o $(TARGET) main.o $(LDFLAGS)
echo "Done"

main.o: src/main.c
Expand All @@ -33,10 +32,24 @@ main.o: src/main.c
clean:
rm -f *.o $(TARGET)

run: all
run: build
./$(TARGET)

install: run
install: build
#mkdir /etc/slide-calculator/ || echo "dir is thare"
#mkdir /etc/slide-calculator/glade/ || echo "dir is thare"
#cp ./remove.sh /etc/slide-calculator/
#cp ./glade/Main.glade /etc/slide-calculator/glade/
mkdir /usr/share/slide-calculator || echo "dir is thare"
cp ./remove.sh /usr/share/slide-calculator
mkdir /usr/share/slide-calculator/glade/ || echo "dir is thare"
cp ./glade/Main.glade /usr/share/slide-calculator/glade/

cp ./slide-calculator.out /usr/bin/slide-calculator

remove:
rm -r /usr/share/slide-calculator
rm /usr/bin/slide-calculator

#gtk:
# sudo apt-get install libgtk-3-dev
Expand Down
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ int main (int argc, char **argv){
gtk_init(&argc, &argv);

// read the glade file
Builder = gtk_builder_new_from_file("glade/Main.glade");
Builder = gtk_builder_new_from_file("/usr/share/slide-calculator/glade/Main.glade");

// some More Init stuff. You know
Main_Window = GTK_WIDGET(gtk_builder_get_object(Builder, "Main Window"));
Expand Down

0 comments on commit fd38c7a

Please sign in to comment.