-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (29 loc) · 827 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
CFLAGS = -Wall -std=gnu99
INCLUDES = -I .
OBJDIR = obj
SERVER_SRCS = message.c ack.c movements.c board.c device.c server.c
SERVER_OBJS = $(addprefix $(OBJDIR)/, $(SERVER_SRCS:.c=.o))
CLIENT_SRCS = message.c ack.c movements.c client.c
CLIENT_OBJS = $(addprefix $(OBJDIR)/, $(CLIENT_SRCS:.c=.o))
all: $(OBJDIR) server client
server: $(SERVER_OBJS)
@echo "Making executable: "$@
@$(CC) $^ -o $@ -lm
client: $(CLIENT_OBJS)
@echo "Making executable: "$@
@$(CC) $^ -o $@ -lm
$(OBJDIR):
@mkdir -p $(OBJDIR)
$(OBJDIR)/%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
run: clean server
@./server 100 input/file_posizioni.txt
clean:
@rm -vf ${SERVER_OBJS}
@rm -vf ${CLIENT_OBJS}
@rm -vf server
@rm -vf client
@rm -vf /tmp/dev_fifo.*
@ipcrm -a
@echo "Removed object files and executables..."
.PHONY: run clean