-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (28 loc) · 1.02 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
CXX=g++
CXXFLAGS=-g -Wall
vpath %.cpp src
vpath %.hpp src
vpath %.o obj
SRCDIR=src
OBJDIR=obj
TARGET=des
default: $(TARGET)
objects = $(addprefix $(OBJDIR)/, main.o feistal.o function.o roundkeys.o utils.o)
$(TARGET): $(objects)
$(CXX) $(XX) -o $(TARGET) $(objects)
$(OBJDIR)/main.o: $(SRCDIR)/main.cpp $(SRCDIR)/roundkeys.hpp $(SRCDIR)/function.hpp $(SRCDIR)/feistal.hpp $(SRCDIR)/utils.hpp | $(OBJDIR)
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJDIR)/feistal.o: $(SRCDIR)/feistal.cpp $(SRCDIR)/roundkeys.hpp $(SRCDIR)/function.hpp $(SRCDIR)/feistal.hpp $(SRCDIR)/utils.hpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJDIR)/function.o: $(SRCDIR)/function.cpp $(SRCDIR)/function.hpp $(SRCDIR)/utils.hpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJDIR)/roundkeys.o: $(SRCDIR)/roundkeys.cpp $(SRCDIR)/roundkeys.hpp $(SRCDIR)/utils.hpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJDIR)/utils.o: $(SRCDIR)/utils.cpp $(SRCDIR)/utils.hpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(OBJDIR):
mkdir -p $(OBJDIR)
clean:
$(RM) $(objects) *~ des
# g++ -c *.cpp -o des
# ./des