Created
May 5, 2017 12:33
-
-
Save j0e1in/745c8abfa4fc2bba5b9b2acf78ede1c6 to your computer and use it in GitHub Desktop.
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
program_NAME := myprogram | |
program_C_SRCS := $(wildcard *.c) | |
program_CXX_SRCS := $(wildcard *.cpp) | |
program_C_OBJS := ${program_C_SRCS:.c=.o} | |
program_CXX_OBJS := ${program_CXX_SRCS:.cpp=.o} | |
program_OBJS := $(program_C_OBJS) $(program_CXX_OBJS) | |
program_INCLUDE_DIRS := | |
program_LIBRARY_DIRS := | |
program_LIBRARIES := | |
CPPFLAGS += $(foreach includedir,$(program_INCLUDE_DIRS),-I$(includedir)) | |
LDFLAGS += $(foreach librarydir,$(program_LIBRARY_DIRS),-L$(librarydir)) | |
LDFLAGS += $(foreach library,$(program_LIBRARIES),-l$(library)) | |
.PHONY: all clean distclean | |
all: $(program_NAME) | |
$(program_NAME): $(program_OBJS) | |
$(LINK.cc) $(program_OBJS) -o $(program_NAME) | |
clean: | |
@- $(RM) $(program_NAME) | |
@- $(RM) $(program_OBJS) | |
distclean: clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment