-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (53 loc) · 1.65 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# compiler
CC=gcc
# debug
DEBUG=#-g
# optimisation
OPT=-pipe -Ofast
# warnings
WARN=-Wextra
PTHREAD=-pthread
CCFLAGS=$(DEBUG) $(OPT) $(WARN) $(PTHREAD) -pipe
GTKLIB=`pkg-config --cflags --libs gtk+-3.0`
# linker
LD=gcc
LDFLAGS=$(PTHREAD) $(GTKLIB) -export-dynamic
all: deb
mkdir-deb:
mkdir ./slide-calculator-1.0/usr/ || echo "dir is thare"
mkdir ./slide-calculator-1.0/usr/bin/ || echo "dir is thare"
mkdir ./slide-calculator-1.0/usr/share/ || echo "dir is thare"
mkdir ./slide-calculator-1.0/usr/share/slide-calculator/ || echo "dir is thare"
mkdir ./slide-calculator-1.0/usr/share/slide-calculator/glade/ || echo "dir is thare"
mkdir:
mkdir ./bin/ || echo "dir is thare"
deb: mkdir-deb build
cp ./bin/slide-calculator.out ./slide-calculator-1.0/usr/bin/slide-calculator
cp ./glade/Main.glade ./slide-calculator-1.0/usr/share/slide-calculator/glade/
dpkg-deb --build ./slide-calculator-1.0/
build: mkdir main.o
$(LD) -o ./bin/slide-calculator.out ./bin/main.o $(LDFLAGS)
echo "Done"
main.o: mkdir src/main.c
$(CC) -c $(CCFLAGS) src/main.c $(GTKLIB) -o ./bin/main.o
clean:
rm -f *.o || echo ""
rm $(TARGET) || echo ""
rm -f ./slide-calculator-1.0/usr/ || echo ""
rm ./bin/slide-calculator.out || echo ""
run: install
slide-calculator
run-deb: install-deb
slide-calculator
install: build
sudo cp ./bin/slide-calculator.out /usr/bin/slide-calculator
sudo cp ./glade/Main.glade /usr/share/slide-calculator/glade/
install-deb: deb
sudo dpkg -i slide-calculator-1.0.deb
remove-deb:
sudo dpkg -r slide-calculator
remove:
sudo rm /usr/bin/slide-calculator
sudo rm -r /usr/share/slide-calculator
#gtk:
# sudo apt-get install libgtk-3-dev