For a task, I've got a Makefile provided with this content:
# Flag that states that warnings will not lead to compilation errors
FORCE = false
# Compiler
CC = gcc
# Doc generator
DOC = doxygen
# Include directories
INCLUDES =
# Compiler flags
CFLAGS_FORCE = -c -g -ansi -pedantic -Wall -Wextra
CFLAGS = $(CFLAGS_FORCE) -Werror
# Linker flags
LDFLAGS =
# Source codes
SOURCE = ueb01.c
OBJECTS = $(SOURCE:.c=.o)
# Target name
BINARY = ueb01
.PHONY: all help clean doc doc
default: all
force:
@make FORCE=true
all: $(BINARY)
# Compile a single file
%.o : %.c
@echo " - Building $@"
ifeq ($(FORCE),true)
$(CC) $(CFLAGS_FORCE) $(INCLUDES) -o $@ $<
else
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $<
endif
@echo " ... done"
# Link files to an executable
$(BINARY): $(OBJECTS)
@echo " - linking $@"
$(CC) $(LDFLAGS) $(OBJECTS) -o $(BINARY)
@echo " ... done"
# Clean the project
clean:
@echo " - delete object all files"
rm -f $(OBJECTS) $(BINARY) *~ doxygen.log
rm -rf doc/
@echo " ... done"
doc:
@echo " - creating documentation"
$(DOC)
@echo " ... done"
# Show help
help:
@echo "Options:"
@echo "make all - create program"
@echo "make clean - clean up"
@echo "make doc - create documentation"
@echo "make force - compile without -Werror (just for 'comfier' development)"
Within same folder as the Makefile, I've got a program.c file that I'd like to execute. The content of that file is not relevant here, because I can't even compile the .c file with the provided Makefile. So when I'm the cmd window and type in make
or make all
, following lines are being displayed:
MAKE Version 5.4 Copyright (c) 1987, 2010 Embarcadero Technologies, Inc.
Error makefile 45: Command syntax error
Error makefile 46: Command syntax error
Error makefile 47: Command syntax error
Error makefile 48: Command syntax error
Error makefile 49: Command syntax error
Error makefile 50: Command syntax error
*** 6 errors during make ***
The Makefile was provided by my supervisors for the task and works fine as it's supposed to do for my friends but strangely not for me.
I've tried to solve this by installing CMake by Kitware but it gives me the same errors. I'm running on Windows 10 (64 Bit).
Thanks in advance! T.T