This repository has been archived by the owner on May 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
95 lines (73 loc) · 2.42 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
######################################
##
## The project Makefile.
##
######################################
HDIR := inc
ODIR := obj
CDIR := src
DOCDIR := html
DESTDIR :=
SOURCES := MatImage.cc TextFile.cc util.cc Error.cc
OBJECTS := $(SOURCES:%.cc=$(ODIR)/%.o)
LIBRARIES := gtkmm-2.4 opencv openssl
CC := g++
CFLAGS := -O `pkg-config --cflags $(LIBRARIES)` -I $(HDIR) -std=c++11
LFLAGS := -O `pkg-config --libs $(LIBRARIES)` -std=c++11
vpath %.h $(HDIR)
vpath %.o $(ODIR)
vpath %.cc $(CDIR)
###################################################### Rules
all: cli gui
cli: steg unsteg
gui: photocrypt
photocrypt: $(OBJECTS) $(ODIR)/main.o $(ODIR)/Win.o
@echo ":: Making $@"
@$(CC) $^ -o $@ $(LFLAGS)
steg: $(OBJECTS) $(ODIR)/steg.o
@echo ":: Making $@"
@$(CC) $^ -o $@ $(LFLAGS)
unsteg: $(OBJECTS) $(ODIR)/unsteg.o
@echo ":: Making $@"
@$(CC) $^ -o $@ $(LFLAGS)
$(ODIR)/%.o: %.cc $(HDIR)/*.h
@echo ":: Compiling $<"
@mkdir -p $(ODIR)
@$(CC) $(CFLAGS) $< -c -o $@
clean: clean-exe clean-obj clean-doc
clean-exe:
@echo ":: Cleaning executables"
@rm -f photocrypt steg unsteg
clean-obj:
@echo ":: Cleaning objects"
@rm -rf $(ODIR)
install: uninstall all
@echo ":: Installing"
@mkdir -p "$(DESTDIR)/opt/photocrypt"
@mkdir -p "$(DESTDIR)/usr/bin"
@cp photocrypt steg unsteg README.md icon.png $(DESTDIR)/opt/photocrypt/
@ln -s /opt/photocrypt/photocrypt $(DESTDIR)/usr/bin/photocrypt
@ln -s /opt/photocrypt/steg $(DESTDIR)/usr/bin/steg
@ln -s /opt/photocrypt/unsteg $(DESTDIR)/usr/bin/unsteg
uninstall:
@echo ":: Uninstalling"
@rm -rf $(DESTDIR)/opt/photocrypt
@rm -f $(DESTDIR)/usr/bin/photocrypt
@rm -f $(DESTDIR)/usr/bin/steg
@rm -f $(DESTDIR)/usr/bin/unsteg
doc: $(HDIR)/* $(CDIR)/* README.md Doxyfile
@doxygen 1>/dev/null 2>&1
@echo ":: Documentation generated."
clean-doc:
@echo ":: Cleaning docs"
@rm -rf "$(DOCDIR)"
help:
@echo "The Makefile defines the following target:"
@echo " make : builds GUI and CLI programs"
@echo " make cli : builds the CLI programs (steg & unsteg)"
@echo " make gui : builds the GUI program (photocrypt)"
@echo " make clean : cleans the built files"
@echo " make install : installs the program into the system"
@echo " make uninstall : uninstalls the program from the system"
@echo " make doc : generates documentation in html"
@echo " make help : displays this help text"