wiki:Tools/Make

Make

The classic and classy tool.

A minimal Makefile template

TARGET=a.out

CC=clang -std=c11 -m64 -march=native -mtune=native -fopenmp=libomp
CXX=clang++ -std=c++1y -stdlib=libc++ -m64 -march=native -mtune=native -fopenmp=libomp

CFLAFS = -W -Wall -Wextra -pedantic -Werror
CXXFLAFS = -W -Wall -Wextra -pedantic -Werror

LDFLAGS= -fopenmp=libomp
CXXLDFLAGS= -stdlib=libc++ -fopenmp=libomp

DEBUG= -Og -g -ggdb

DEPS=
OBJS= foo1.o

LIBS=

.PHONY: default all clean

default: $(TARGET)

%.o: %.c $(DEPS)
        $(CC) $(CFLAFS) $(DEBUG) -c -o $@ $< 

$(TARGET): $(OBJS)
        $(CC) -o $@ $^ $(LDFLAGS) $(DEBUG) $(LIB)

clean:
        -rm -f *.o *~
        -rm -f $(TARGET)
Last modified 2 years ago Last modified on Dec 29, 2018, 9:11:46 AM
Note: See TracWiki for help on using the wiki.