Skip to content

Instantly share code, notes, and snippets.

@isaac-weisberg
Last active October 17, 2018 16:23
Show Gist options
  • Save isaac-weisberg/fbe6f9b945f80325bd3f02ac486b4835 to your computer and use it in GitHub Desktop.
Save isaac-weisberg/fbe6f9b945f80325bd3f02ac486b4835 to your computer and use it in GitHub Desktop.
Most orthodox starter Makefile for C-based projects
CC=clang
LD=ld
LDFLAGS=-lc
CCFLAGS=
EXEC=bin/a.out
OBJECTS=src/main.o \
default: run
%.o: %.c
$(CC) -c $< -o $@ $(CCFLAGS)
$(EXEC): $(OBJECTS)
$(LD) $(OBJECTS) -o $(EXEC) $(LDFLAGS)
run: $(EXEC)
$(EXEC)
clean:
-rm -rf $(EXEC) $(OBJECTS)
@bu4ak
Copy link

bu4ak commented Oct 5, 2018

Свистит от души

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment