forked from TrachtmanLior/SystemProgrammingAEx2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
39 lines (27 loc) · 589 Bytes
/
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
CC = gcc
AR = ar
# Objects variables
GRAPH_MAIN_OBJECT = my_graph.o
LIB_OBJECTS = my_mat.o
KNAPSACK_MAIN_OBJECT = my_Knapsack.o
DEPS = my_mat.h
# Librarys variables
LIB_S = lib_mat.a
# FLAGS
CFLAGS = -Wall -g
# Declare non-files
.PHONY: all clean
all: my_graph my_Knapsack
# Programs
my_graph: $(GRAPH_MAIN_OBJECT) $(LIB_S)
$(CC) $(CFLAGS) $^ -o $@
my_Knapsack: $(KNAPSACK_MAIN_OBJECT)
$(CC) $(CFLAGS) $^ -o $@
# All object files:
*.o: *.c $(DEPS)
$(CC) $(CFLAGS) -c $^
# Libraries:
$(LIB_S): $(LIB_OBJECTS)
$(AR) rcs $@ $^
clean:
rm -f *.o *.a my_graph my_Knapsack *.gch