Skip to content

Instantly share code, notes, and snippets.

@Idorobots
Created October 14, 2012 20:27
Show Gist options
  • Save Idorobots/3889721 to your computer and use it in GitHub Desktop.
Save Idorobots/3889721 to your computer and use it in GitHub Desktop.
sample makefile
RM = rm
CC = gcc
CFLAGS = -Wall -pedantic -O4 -ffast-math
LDLIBS = -lm
TARGET = foo
OBJS = foo.o main.o
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $^ $(LDLIBS) -o$@
%.o: %.c
$(CC) $(CFLAGS) $^ -c
clean:
$(RM) $(OBJS) $(TARGET)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment