49 lines
1.6 KiB
Makefile
49 lines
1.6 KiB
Makefile
|
CC = cc # C compiler
|
||
|
# cc and gcc is the same
|
||
|
CXX = c++ # C++ compiler
|
||
|
# c++
|
||
|
# g++
|
||
|
# clang++
|
||
|
CPPFLAGS = # preprocessor flags
|
||
|
CFLAGS = -Wall -Wfloat-equal -std=c99 -O0 -mtune=native -funroll-loops $(OPT) # C compiler flags
|
||
|
# -Wall: Warnings all
|
||
|
# -Wfloat-equal: Warn if comparing floats with ==
|
||
|
# -OX: Optimization level -O0 (none, default), -O1, -O2, -O3 (most, may increase file size), -Os (decrease file size), -ffast-math
|
||
|
# -mtune: Tune for specific/generic CPU
|
||
|
# -funrool-loops: Unroll loops when compiling
|
||
|
# -fopenmp: Enable OpenMP (When running, set the environmental variable OMP_NUM_THREADS)
|
||
|
# $(OPT): Passes any parameter given when calling make with 'make OPT=...'
|
||
|
CXXFLAGS = -Wall -std=c++17 -O0 # C++ compiler flags
|
||
|
LDFLAGS = # linker flags
|
||
|
LDLIBS = # library flags
|
||
|
# -lm (for <math.h>)
|
||
|
# -lblas (BASIC LINEAR ALGEBRA SUBPROGRAMS)
|
||
|
# -lcblas (for <cblas.h>)
|
||
|
# -lopenblas (NOT INSTALLED; blas and cblas in one; conflicts with blas and cblas)
|
||
|
# -llapack (LAPACKE)
|
||
|
# -llapacke (LAPACK) NOTE: The order of "-llapacke -llapack -lblas" is very important
|
||
|
#LINK.o = $(CXX) $(LDFLAGS) # use CXX for linking
|
||
|
|
||
|
# What to do when making ex1.c
|
||
|
#ex1: datasize1.o
|
||
|
|
||
|
# What to do when making ex1.cpp (C++ style)
|
||
|
#ex1: datasize1.cpp
|
||
|
|
||
|
ex53: hashed_string.cpp hash_table.cpp hashing_algorithms.cpp
|
||
|
|
||
|
eq17: hashed_string.cpp hash_table.cpp hashing_algorithms.cpp
|
||
|
|
||
|
# Tell the compiler that 'clean' isn't referring to a file
|
||
|
#.PHONY: clean
|
||
|
# A make target that cleans (by deleting files)
|
||
|
|
||
|
clean:
|
||
|
$(RM) fast_modulo *.o
|
||
|
$(RM) eq17 *.o
|
||
|
$(RM) ex53 *.o
|
||
|
$(RM) hashed_string *.o
|
||
|
$(RM) hash_table *.o
|
||
|
|
||
|
fast_modulo:
|