Skip to content

Instantly share code, notes, and snippets.

@lxfontes
Created April 12, 2011 20:49
Show Gist options
  • Save lxfontes/916372 to your computer and use it in GitHub Desktop.
Save lxfontes/916372 to your computer and use it in GitHub Desktop.
c++ sample makefile
CC = g++
CFLAGS = -Wall -O2
LDFLAGS = -lpcap
OBJFILES := $(patsubst %.cc,%.o,$(wildcard *.cc))
PROG=pcapr
COMPILE = $(CC) $(CFLAGS) -c
all: $(PROG)
$(PROG): $(OBJFILES)
$(CC) -o $(PROG) $(OBJFILES) $(LDFLAGS)
%.o: %.cc
$(COMPILE) -o $@ $<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment