-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (21 loc) · 730 Bytes
/
Makefile
File metadata and controls
27 lines (21 loc) · 730 Bytes
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
CC=gcc
LFLAGS=-lz
CFLAGS=-g -W -Wall -DNDEBUG
SOURCES=$(wildcard src/*.c)
HEADERS=$(SOURCES:.c=.h)
OBJ=$(SOURCES:.c=.o)
ROBJ=src/create_socket.o src/packet_implem.o src/read_write_loop.o src/real_address.o src/receiver.o src/wait_for_client.o
SOBJ=src/create_socket.o src/packet_implem.o src/read_write_loop.o src/real_address.o src/sender.o src/wait_for_client.o
all: sender receiver
src/%.o: %.c $(HEADER)
@echo "$^"
$(CC) $(LFLAGS) -c $< $(CFLAGS)
receiver: $(ROBJ)
@echo "Begin building receiver"
$(CC) -o $@ $^ $(LFLAGS) $(CFLAGS)
sender: $(SOBJ)
@echo "Begin building sender"
$(CC) -o $@ $^ $(LFLAGS) $(CFLAGS)
clean:
(cd src; rm -f *.o; cd ..; rm -f receiver; rm -f sender)
@echo "cleaning"