Why does Make automatically execute a cc command?

I’m trying to learn how to use Make! So I have this simple Makefile, all: main other main: main.c other.o gcc main.c -o main echo "Compiled main.exe" other: other.o other.c: touch $@ echo "int main(){return 0;}" > $@ echo "Created other.c" other.o: other.c gcc other.c -o other.o echo "Compiled other.o" clean: rm -f main.exe other.o… Read More Why does Make automatically execute a cc command?

Make with arguments

I have python script inside container which needs two arguments to run. I tried to run the script using Makefile. For this I made make command: .PHONY: deploy deploy: @docker exec -it ecosystem python3 deployment/deploy.py $(filter-out $@,$(MAKECMDGOALS)) When I run make deploy server project, the script works, but when it finishes I get the following… Read More Make with arguments

C Makefile – How to avoid redundant mentions of file names

For an assignment in one of my classes we need to create a makefile for our C program that’s more complex than just compile: gcc whatever. I believe we’re expected to do something like this: outputname: file1.o file2.o file3.o file4.o gcc -o outputname file1.o file2.o file3.o file4.o clean: rm -f outputname file1.o file2.o file3.o file4.o… Read More C Makefile – How to avoid redundant mentions of file names

Why does the gnu make command default to compiling c files with the same name

environment os: macos 12.6.3 (intel) gnu make: 3.81 execute command: make -v get: GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This program built for i386-apple-darwin11.3.0 steps The directory… Read More Why does the gnu make command default to compiling c files with the same name

make: *** No rule to make target 'obj/main.o', needed by 'myftp'. Stop

I’m making an FTP server from scratch in C. I need a makefile to compile. his is the architecture of my project : / include / header file (*.h) src / potential sub directories / *.c *.c main.c Makefile this is my makefile : SRC := main.c $(wildcard src/*.c) $(wildcard src/**/*.c) OBJ := $(SRC:%.c=obj/%.o) DEP… Read More make: *** No rule to make target 'obj/main.o', needed by 'myftp'. Stop