0

I'm trying to compile multiple files in the same time but I don't know why the client command doesn't compile, but when I run it separately in the terminal it works at it should be.

CC = gcc

UTILS = utils/*.c
ENTRY = main.c
TARGET = bin/main.exe

CLIENT_ENTRY = server/client.c
CLIENT_TARGET = bin/client.exe

SERVER_ENTRY = server/server.c
SERVER_TARGET = bin/server.exe


terminal: 
    $(CC) $(UTILS) $(ENTRY) -o $(TARGET) -lreadline


client:
    $(CC) $(CLIENT_ENTRY) -o $(CLIENT_TARGET)



all: terminal client
Mudu
  • 91
  • 5
  • Which line exactly is it complaining about? You have used tabs for indentation, right? – tripleee Jan 10 '23 at 07:30
  • The problem is on the line 19 and I didn't use indentation in the Makefile – Mudu Jan 10 '23 at 07:36
  • tried removing all the indentation and now I'm getting "make: *** No rule to make target 'gcc', needed by 'terminal'. Stop." – Mudu Jan 10 '23 at 07:41
  • You weren't suppose to remove indentation. You were supposed to replace spaces with tabs. – Harith Jan 10 '23 at 07:42
  • It goes back to saying that I got an error on line 19 – Mudu Jan 10 '23 at 07:45
  • You have not put a true TAB character in your file. You have simply indented with spaces. Note that even if you typed the TAB key on your keyboard, that doesn't guarantee that your editor didn't actually write out spaces instead. If that happened, you need to get a better editor: yours is not a real programmer's editor. – MadScientist Jan 10 '23 at 13:53
  • I guess NeoVim isn't a real editor nowadays ¯\_(ツ)_/¯ – Mudu Jan 10 '23 at 15:34

0 Answers0