I am using Visual Studio Code and I keep getting the following error message when I use run make: "makefile:20: *** missing separator. Stop." For some reason my indent is not showing up as ^I when I run: cat -e -t -v makefile. Anybody have any ideas? I tried checking the settings of Visual Studio Code and an indent is not replaced with spaces during the build process.
TARGET = shell
CC = gcc
CFLAGS = -Wall -Wextra -std=c99
SOURCES = main.c builtin.c execute.c shell.c
# Define the header files
HEADERS = myheader1.h myheader2.h
# Define the object files
OBJECTS = $(SOURCES:.c=.o) $(HEADERS:.h=.h.gch)
# Define the default target
all: $(TARGET)
# Define the target binary
$(TARGET): $(OBJECTS)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS)
# Define a pattern rule for building object files
%.o: %.c $(HEADERS)
$(CC) $(CFLAGS) -I. -c $< -o $@
# Define a pattern rule for building precompiled headers
%.h.gch: %.h
$(CC) $(CFLAGS) -I. -c $< -o $@
cat -e -t -v makefile
$
CC = gcc$
$
CFLAGS = -Wall -Wextra -std=c99$
$
SOURCES = main.c builtin.c execute.c shell.c$
$
# Define the header files$
HEADERS = myheader1.h myheader2.h$
$
# Define the object files$
OBJECTS = $(SOURCES:.c=.o) $(HEADERS:.h=.h.gch)$
$
# Define the default target$
all: $(TARGET)$
$
# Define the target binary$
$(TARGET): $(OBJECTS)$
$(CC) $(CFLAGS) -o $(TARGET) $(OBJECTS)$
$
# Define a pattern rule for building object files$
%.o: %.c $(HEADERS)$
$(CC) $(CFLAGS) -I. -c $< -o $@$
$
# Define a pattern rule for building precompiled headers$
%.h.gch: %.h$
$(CC) $(CFLAGS) -I. -c $< -o $@$
$
$
$
$
$