Last active
February 21, 2017 16:53
-
-
Save yuikns/8cd3903fdef40c18031a4f9c470bb396 to your computer and use it in GitHub Desktop.
an example for makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CC := cc | |
CXX := c++ | |
CP := @cp | |
MV := @mv | |
DEL := @rm -rf | |
LIBS := -ldl -lpthread -lm #-L lib/ | |
INFLAGS := -I include/ | |
CFLAGS := -Wall ${INFLAGS} -std=c99 | |
GNUFLAGS := -Wall ${INFLAGS} -std=gnu99 | |
CXXFLAGS := -Wall ${INFLAGS} -std=c++11 | |
LDFLAGS := ${LIBS} | |
OBJS := main.o | |
PROGS := main | |
.PHONY : main clean | |
main: ${OBJS} | |
${CC} -o $@ ${CFLAGS} ${LDFLAGS} ${OBJS} | |
# ${CXX} -o $@ ${CXXFLAGS} ${LDFLAGS} ${OBJS} | |
${OBJS} : | |
clean: | |
-${DEL} ${PROGS} ${OBJS} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment