Skip to content

Instantly share code, notes, and snippets.

@zetaraku
Last active October 22, 2018 16:47
Show Gist options
  • Save zetaraku/b4ca9da82784588756c697bf7bacc388 to your computer and use it in GitHub Desktop.
Save zetaraku/b4ca9da82784588756c697bf7bacc388 to your computer and use it in GitHub Desktop.
CC = gcc
RM = rm -f
CFLAGS = -Wall -I /path/to/include
LDFLAGS = -L /path/to/lib
LIBS = -lm
OBJECTS = hello_world.o
TARGETS = a.out
main: $(TARGETS)
$(TARGETS): $(OBJECTS)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS)
%.o: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -c $<
clean:
$(RM) $(TARGETS) *.o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment