@@ -1,25 +1,26 @@
|
|
1 |
-
|
|
|
|
|
2 |
CXX=g++
|
3 |
-
FLAGS=-g -Wall -Wextra
|
4 |
-
CFLAGS=$(FLAGS)
|
5 |
-
CXXFLAGS=$(FLAGS)
|
6 |
LIBS=
|
7 |
|
8 |
-
HEADERS=$(wildcard *.h)
|
9 |
-
SOURCES=$(wildcard *.c*)
|
10 |
-
COBJECTS=$(SOURCES:.c=.o)
|
11 |
-
OBJECTS=$(COBJECTS:.cpp=.o)
|
12 |
-
EXECUTABLE=$(shell basename `pwd`)
|
13 |
|
14 |
-
|
15 |
-
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
$(CXX)
|
19 |
|
20 |
-
%.o: %.c $(HEADERS)
|
21 |
-
$(CC) -c -o $@ $< $(CFLAGS)
|
22 |
|
23 |
.PHONY: clean
|
24 |
clean:
|
25 |
-
rm -
|
|
|
|
|
|
|
|
1 |
+
APPNAME=$(shell basename `pwd`)
|
2 |
+
|
3 |
+
CC=cc
|
4 |
CXX=g++
|
5 |
+
FLAGS=-g -Wall -Wextra -fopenmp
|
6 |
+
CFLAGS=$(FLAGS)
|
7 |
+
CXXFLAGS=$(FLAGS)
|
8 |
LIBS=
|
9 |
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
all: $(APPNAME)
|
12 |
+
|
13 |
+
%: %.c
|
14 |
+
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
|
15 |
|
16 |
+
%: %.cpp
|
17 |
+
$(CXX) $(CXXFLAGS) $^ -o $@ $(LIBS)
|
18 |
|
|
|
|
|
19 |
|
20 |
.PHONY: clean
|
21 |
clean:
|
22 |
+
rm -f $(APPNAME) *.o
|
23 |
+
|
24 |
+
.PHONY: gitignore
|
25 |
+
gitignore:
|
26 |
+
echo $(APPNAME) > .gitignore
|