My Makefile:
HEADERS = headers.h macros.h main.h socket.h
main.o : main.c main.h
cc -c main.c
socket.o : socket.c headers.h macros.h
cc -c socket.c
main.c
#include "main.h"
main()
{
printf("%s\n","Connect_Socket Start");
Connect_Socket(IP_ADDRESS, PORT);
printf("%s\n","Connect_Socket End");
while(1)
{
Send_Message();
Recv_Message();
}
Close_Socket();
}
socket.c
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <errno.h>
#include "headers.h"
#include "macros.h"
void Connect_Socket() {
}
int Send_Message() {
}
int Recv_Message() {
}
void Close_Socket() {
}
socket.h
macros.h
headers.h
main.h
#include "headers.h"
#include "socket.h"
#include "macros.h"
#include "MQTTPacket/MQTTPacket.h"
When executing
$make
on terminal, I am not getting any errors. However, I am also not getting any of the printf() messages.
What I have tried:
I tried changing my makefile to:
cc = gcc
OBJFILES = socket.o main.o
TARGET = mqtt_c8y
all: $(TARGET)
$TARGET: $(OBJFILES)
$(CC) -o $(TARGET) $(OBJFILES)
However, when commenting the function calls in main.c and compiling simply main.c with
$gcc main.c
and then
$./a.out
, I do get the printf() messages.