Skip to content

Instantly share code, notes, and snippets.

@elvinio
Created July 24, 2015 01:21
Show Gist options
  • Save elvinio/72b252afeb636bbfb70f to your computer and use it in GitHub Desktop.
Save elvinio/72b252afeb636bbfb70f to your computer and use it in GitHub Desktop.
An example makefile
CC = g++ -c -g -Wall -I .
LINKER = g++
PLATFORMLINK = -lstdc++ -lpthread -ldl -lssl
OBJFILES = ${patsubst %.cpp,%.o,${wildcard *.cpp))
all:Program
%.o: $.cpp
$(CC) -o $@ $<
Program: $(OBJFILES)
$(LINKER) -o $@ $(OBJFILES) $(PLATFORMLINK)
clean:
rm -f *.o *~ Program core
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment