Create src folder
Co-authored-by: Ezequiel Bellver <ebellver@itba.edu.ar> Co-authored-by: Juan Barmasch <jbarmasch@itba.edu.ar>
This commit is contained in:
parent
465b264684
commit
9872bbafde
18
Makefile
18
Makefile
|
@ -3,29 +3,29 @@ CCFLAGS = -Wall -std=c99 -pedantic -g
|
|||
|
||||
CLIENT=client
|
||||
SERVER=server
|
||||
ERROR=errors.o
|
||||
CHALLENGE=challenges.o
|
||||
ERRORS=errors.o
|
||||
CHALLENGES=challenges.o
|
||||
RANDOM=random.o
|
||||
SOCKETS=sockets.o
|
||||
|
||||
TMP := $(shell mktemp)
|
||||
|
||||
all: $(ERROR) $(CHALLENGE) $(RANDOM) $(SOCKETS) $(CLIENT) $(SERVER)
|
||||
all: $(ERRORS) $(CHALLENGES) $(RANDOM) $(SOCKETS) $(CLIENT) $(SERVER)
|
||||
|
||||
$(SERVER): server.c challenges.c errors.c sockets.c include/errors.h include/challenges.h include/server.h include/challengesLib.h include/sockets.h
|
||||
$(CC) $(CCFLAGS) server.c -o server challenges.o errors.o random.o sockets.o -lm
|
||||
$(SERVER): src/server.c src/challenges.c src/errors.c src/sockets.c include/errors.h include/challenges.h include/server.h include/challengesLib.h include/sockets.h
|
||||
$(CC) $(CCFLAGS) src/server.c -o server $(CHALLENGES) $(ERRORS) $(RANDOM) $(SOCKETS) -lm
|
||||
objcopy --add-section .RUN_ME="$(TMP)" --set-section-flags .mydata=noload,readonly server
|
||||
strip --strip-debug server
|
||||
rm "$(TMP)"
|
||||
|
||||
$(CLIENT): client.c errors.c sockets.c include/errors.h include/client.h include/sockets.h
|
||||
$(CC) $(CCFLAGS) client.c -o client errors.o sockets.o
|
||||
$(CLIENT): src/client.c src/errors.c src/sockets.c include/errors.h include/client.h include/sockets.h
|
||||
$(CC) $(CCFLAGS) src/client.c -o client $(ERRORS) $(SOCKETS)
|
||||
|
||||
%.o: %.c
|
||||
%.o: src/%.c
|
||||
$(CC) $(CCFLAGS) -I./include -c $<
|
||||
|
||||
clean:
|
||||
rm -rf $(ERROR) $(CHALLENGE) $(CLIENT) $(SERVER) $(RANDOM) $(SOCKETS)
|
||||
rm -f $(ERRORS) $(CHALLENGES) $(CLIENT) $(SERVER) $(RANDOM) $(SOCKETS)
|
||||
|
||||
test:
|
||||
pvs-studio-analyzer trace -- make
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// This is a personal academic project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
#include "include/challenges.h"
|
||||
#include "../include/challenges.h"
|
||||
|
||||
char genChallenge(FILE * stream, char ** output, challenge_t challenge) {
|
||||
printf("------------- DESAFIO -------------\n");
|
|
@ -1,6 +1,6 @@
|
|||
// This is a personal academic project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
#include "include/client.h"
|
||||
#include "../include/client.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int fd = createSocket();
|
|
@ -1,6 +1,6 @@
|
|||
// This is a personal academic project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
#include "include/errors.h"
|
||||
#include "../include/errors.h"
|
||||
|
||||
void printError(char * string) {
|
||||
fprintf(stderr, "%s\n", string);
|
|
@ -1,6 +1,6 @@
|
|||
// This is a personal academic project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
#include "include/random.h"
|
||||
#include "../include/random.h"
|
||||
|
||||
static uint32_t m_z = 362436069;
|
||||
static uint32_t m_w = 521288629;
|
|
@ -1,6 +1,6 @@
|
|||
// This is a personal academic project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
#include "include/server.h"
|
||||
#include "../include/server.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
int fd = createSocket();
|
|
@ -1,6 +1,6 @@
|
|||
// This is a personal academic project. Dear PVS-Studio, please check it.
|
||||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
#include "include/sockets.h"
|
||||
#include "../include/sockets.h"
|
||||
|
||||
int createSocket() {
|
||||
int fd;
|
Loading…
Reference in New Issue