update makefile with all headers as dependencies
This commit is contained in:
30
Makefile
30
Makefile
@ -1,7 +1,5 @@
|
||||
CC = gcc
|
||||
AR = ar
|
||||
CFLAGS += -std=c99 -Wall -Werror -pedantic -g
|
||||
ARFLAGS = rvs
|
||||
INCDIR = ./lib/utils ./lib/ini ./lib/threadpool ./src ./lib/log
|
||||
INCLUDES := $(patsubst %,-I %,$(INCDIR))
|
||||
LDFLAGS = -L .
|
||||
@ -31,26 +29,26 @@ all: $(BUILD_DIR)/server
|
||||
|
||||
|
||||
|
||||
$(OBJ_DIR)/fileQueue.o: fileQueue.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $^ -o $@
|
||||
$(OBJ_DIR)/fileQueue.o: fileQueue.c fileQueue.h conn.h fileQueue.h util.h
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
|
||||
|
||||
$(OBJ_DIR)/apiFile.o: apiFile.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $^ -o $@
|
||||
$(OBJ_DIR)/apiFile.o: apiFile.c apiFile.h fileQueue.h taglialegna.h conn.h
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
|
||||
|
||||
$(OBJ_DIR)/taglialegna.o: taglialegna.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $^ -o $@
|
||||
$(OBJ_DIR)/taglialegna.o: taglialegna.c taglialegna.h fileQueue.h
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
|
||||
|
||||
$(OBJ_DIR)/threadpool.o: threadpool.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $^ -o $@
|
||||
$(OBJ_DIR)/threadpool.o: threadpool.c util.h threadpool.h
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
|
||||
|
||||
$(OBJ_DIR)/ini.o: ini.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $^ -o $@
|
||||
$(OBJ_DIR)/ini.o: ini.c ini.h
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
|
||||
|
||||
$(OBJ_DIR)/serverWorker.o: serverWorker.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $^ -o $@
|
||||
$(OBJ_DIR)/serverWorker.o: serverWorker.c serverWorker.h apiFile.h fileQueue.h taglialegna.h threadpool.h conn.h message.h
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
|
||||
|
||||
$(OBJ_DIR)/server.o: server.c
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $^ -o $@
|
||||
$(OBJ_DIR)/server.o: server.c threadpool.h conn.h util.h serverWorker.h ini.h serverUtil.h fileQueue.h taglialegna.h
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
|
||||
|
||||
$(BUILD_DIR)/server: $(OBJ_SERVER)
|
||||
$(CC) $(CFLAGS) $(LIBS) $(OBJ_SERVER) -o $(BUILD_DIR)/server
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <taglialegna.h>
|
||||
#include <fileQueue.h>
|
||||
|
||||
@ -2,6 +2,9 @@
|
||||
#ifndef _TAGLIALEGNA
|
||||
#define _TAGLIALEGNA
|
||||
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <fileQueue.h>
|
||||
|
||||
typedef struct taglia_s {
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
#include <strings.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <conn.h>
|
||||
#include <apiFile.h>
|
||||
#include <fileQueue.h>
|
||||
#include <taglialegna.h>
|
||||
|
||||
#define MAXLENMESS 512
|
||||
|
||||
@ -2,15 +2,17 @@
|
||||
#ifndef _API_FILE
|
||||
#define _API_FILE
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include <fileQueue.h>
|
||||
#include <taglialegna.h>
|
||||
/* TODO: finire tutte le descrizioni */
|
||||
|
||||
// Lista dei client in attesa su una lock
|
||||
typedef struct struct_waiting {
|
||||
long fd; // client in attesa
|
||||
char *file; // file su cui si vuole acquisire la lock
|
||||
struct struct_waiting *next; // puntatore al prossimo elemento della lista
|
||||
long fd; // client in attesa
|
||||
char *file; // file su cui si vuole acquisire la lock
|
||||
struct struct_waiting *next; // puntatore al prossimo elemento della lista
|
||||
} waiting_t;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <fileQueue.h>
|
||||
#include <util.h>
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
#define _FILE_QUEUE
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include <conn.h>
|
||||
|
||||
// struttura dati per gestire i file in memoria principale
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include <sys/select.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include <conn.h>
|
||||
#include <message.h>
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
#ifndef SERVERWORKER
|
||||
#define SERVERWORKER
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include <apiFile.h>
|
||||
#include <fileQueue.h>
|
||||
#include <taglialegna.h>
|
||||
|
||||
Reference in New Issue
Block a user