blob: 019ec29a6aa9e8a27c1bd7efc0aadaf332067be5 (
plain) (
blame)
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
|
.PHONY: clean, mrproper
CC = gcc
CXX = g++
LD = gcc
LDFLAGS = -lstdc++
CFLAGS =
CXXFLAGS =
OutFile = MakeRamFS
Objects = main.o
all: $(OutFile)
echo "* Done with $(OutFile)."
rebuild: mrproper all
$(OutFile): $(Objects)
echo "* Linking executable : $(OutFile)..."
$(LD) -o $(OutFile) $(LDFLAGS) $^
%.o: %.c
echo "* Compiling $<..."
$(CC) -c $< -o $@ $(CFLAGS)
%.o: %.cpp
echo "* Compiling $<..."
$(CXX) -c $< -o $@ $(CXXFLAGS)
clean:
echo "* Removing object files..."
rm -rf *.o
rm -rf */*.o
rm -rf */*/*.o
mrproper: clean
echo "* Removing executable : $(OutFile)"
rm -rf $(OutFile)
|