Skip to content

Instantly share code, notes, and snippets.

@XuankangLin
Created September 14, 2015 16:07
Show Gist options
  • Select an option

  • Save XuankangLin/e277d042cdc7a494aecb to your computer and use it in GitHub Desktop.

Select an option

Save XuankangLin/e277d042cdc7a494aecb to your computer and use it in GitHub Desktop.
Setting full path in Makefile under some directory
CC=g++
HDIR=./include/
CFILES=main.cpp server.cpp
OUTNAME=server
# Something like this will prepend "./src/" to each of CFILES names, thus setting the correct full path!
CFULL=${CFILES:%=./src/%}
all:
$(CC) -o $(OUTNAME) -pthread -I $(HDIR) $(CFULL)
clear:
rm -f *.out $(OUTNAME)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment