Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # See gcc/clang manual to understand all flags
- CFLAGS += -std=c99 # Define which version of the C standard to use
- CFLAGS += -Wall # Enable the 'all' set of warnings
- CFLAGS += -Werror # Treat all warnings as error
- CFLAGS += -Wshadow # Warn when shadowing variables
- CFLAGS += -Wextra # Enable additional warnings
- CFLAGS += -O2 -D_FORTIFY_SOURCE=2 # Add canary code, i.e. detect buffer overflows
- CFLAGS += -fstack-protector-all # Add canary code to detect stack smashing
- CFLAGS += -D_POSIX_C_SOURCE=201112L -D_XOPEN_SOURCE # feature_test_macros for getpot and getaddrinfo
- LCFLAGS = -lz
- CC = gcc
- TESTS = tests/
- all: receiver sender clean
- sender: sender.o socket.h packet.o
- @$(CC) -c sender.c -o sender.o $(CFLAGS) $(LCFLAGS)
- @$(CC) sender.o packet.o -o sender $(CFLAGS) $(LCFLAGS)
- receiver: receiver.o socket.h packet.o
- @$(CC) -c receiver.c -o receiver.o $(CFLAGS) $(LCFLAGS)
- @$(CC) receiver.o packet.o -o receiver $(CFLAGS) $(LCFLAGS)
- packet.o: packet_interface.h packet_implem.c
- @$(CC) -c packet_implem.c -o packet.o $(CFLAGS) $(LDFLAGS)
- tests: linksim maketest
- linksim:
- cd $(TESTS)LINGI1341-linksim-master && make
- maketest:
- cd $(TESTS) && make
- clean:
- @rm -f *.o *.o
- mrproper: clean
- @rm -f receiver sender
- @rm -f $(TESTS)*.log $(TESTS)received_file $(TESTS)input_file
- @rm -f *.log received_file input_file
- .PHONY: tests
- .PHONY: compile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement