Dev Tool

Makefile Generator

Generate professional Makefiles for C, C++, Node.js, Python, Go, Rust, Java, and more. Live preview with correct tab indentation.

⚒️Project Type

⚙️Variables

🎯Standard Targets

✏️Custom Targets

Add custom Makefile targets with your own commands.

👁️Generated Makefile

# Generated by TinyHub.tools Makefile Generator
# https://tinyhub.tools/dev-tools/makefile-generator

CC      = gcc
CFLAGS  = -Wall -Wextra -O2
LDFLAGS = 
PREFIX  = /usr/local
SRCDIR  = src
BUILDDIR= build
TARGET  = app

SRCS    = $(wildcard $(SRCDIR)/*.c)
OBJS    = $(patsubst $(SRCDIR)/%.c,$(BUILDDIR)/%.o,$(SRCS))

.PHONY: all clean install run test help

all: $(BUILDDIR) $(TARGET)

$(BUILDDIR):
	mkdir -p $(BUILDDIR)

$(TARGET): $(OBJS)
	$(CC) $(OBJS) -o $(TARGET) $(LDFLAGS)

$(BUILDDIR)/%.o: $(SRCDIR)/%.c
	$(CC) $(CFLAGS) -c $< -o $@

run: all
	./$(TARGET)

test:
	@echo "Running tests..."
	./run_tests.sh

clean:
	rm -rf $(BUILDDIR) $(TARGET)

install: all
	install -d $(PREFIX)/bin
	install -m 755 $(TARGET) $(PREFIX)/bin/$(TARGET)

help:
	@echo "Available targets:"
	@echo "  make all          - Default build target"
	@echo "  make clean        - Remove build artifacts"
	@echo "  make install      - Install to PREFIX"
	@echo "  make run          - Build and run"
	@echo "  make test         - Run tests"
	@echo "  make help         - Show available targets"

⚠️ Makefile indentation uses real tab characters (not spaces). The generator ensures correct tab indentation automatically.

Share this tool