Minor changes

This commit is contained in:
Loic Guegan 2023-07-15 08:38:33 +02:00
parent c84520472c
commit f89a58860e
8 changed files with 14 additions and 65 deletions

4
.gitignore vendored
View file

@ -1,7 +1,5 @@
# Binary
/client
/publisher
/logger
/bin
# Logs
/logs

View file

@ -3,27 +3,21 @@ include $(CONF)
CC="gcc"
CFLAGS=
all: publisher client logger
all: pre-build bin/publisher bin/client bin/logger
publisher:
@echo "---------- Building publisher..."
CFLAGS=$(CFLAGS) \
$(MAKE) -C src/publisher/ CC=$(CC) OUT=$(PWD) CONF=$(CONF)
pre-build:
mkdir -p bin/
client:
@echo "---------- Building client..."
CFLAGS=$(CFLAGS) \
$(MAKE) -C src/client/ CC=$(CC) OUT=$(PWD) CONF=$(CONF)
bin/publisher: src/publisher.c
$(CC) -lzmq $^ -o $@
logger:
@echo "---------- Building logger..."
CFLAGS=$(CFLAGS) \
$(MAKE) -C src/logger/ CC=$(CC) OUT=$(PWD) CONF=$(CONF)
bin/client: src/client.c
$(CC) -lzmq $^ -o $@
bin/logger: src/logger.c
$(CC) $^ -o $@
clean:
$(MAKE) clean -C src/publisher/ OUT=$(PWD)
$(MAKE) clean -C src/client/ OUT=$(PWD)
$(MAKE) clean -C src/logger/ OUT=$(PWD)
rm -rf bin/
.PHONY: clean publisher client logger

View file

@ -6,7 +6,7 @@
#include <time.h>
#include <string.h>
#include "../utils.h"
#include "utils.h"
int main (int argc, char *argv [])

View file

@ -1,15 +0,0 @@
include $(CONF)
EXEC=client
CFLAGS+=-lzmq
DEFINES=\
-DPUBLISHER_PORT=$(PUBLISHER_PORT) \
-DPUBLISHER_ADDR=$(PUBLISHER_ADDR)
all: main.c
$(CC) $^ -o $(OUT)/$(EXEC) $(CFLAGS) $(DEFINES)
clean:
rm -f $(OUT)/$(EXEC)
.PHONY: clean

View file

@ -9,7 +9,7 @@
#include <libgen.h>
#include <unistd.h>
#include <sys/stat.h>
#include "../utils.h"
#include "utils.h"
#include <time.h>
void start(char *power_path, char *busid, char *chipaddr);

View file

@ -1,13 +0,0 @@
include $(CONF)
EXEC=logger
DEFINES=\
-DLOGGER_DIR=$(LOGGER_DIR)
all: main.c
$(CC) $^ -o $(OUT)/$(EXEC) $(CFLAGS) $(DEFINES)
clean:
rm -f $(OUT)/$(EXEC)
.PHONY: clean

View file

@ -6,7 +6,7 @@
#include <assert.h>
#include <time.h>
#include "../utils.h"
#include "utils.h"
int main (void)
{

View file

@ -1,15 +0,0 @@
include $(CONF)
EXEC=publisher
CFLAGS+=-lzmq
DEFINES=\
-DPUBLISHER_PORT=$(PUBLISHER_PORT) \
-DPUBLISHER_ADDR=$(PUBLISHER_ADDR)
all: main.c
$(CC) $^ -o $(OUT)/$(EXEC) $(CFLAGS) $(DEFINES)
clean:
rm -f $(OUT)/$(EXEC)
.PHONY: clean