makefile (1047B)
1 # Interface: 2 # make 3 # make build 4 # make format 5 # make run 6 7 # Compiler 8 CC=gcc 9 # CC=tcc # <= faster compilation 10 11 # Main file 12 SRC=samples.c 13 OUTPUT=samples 14 15 ## Dependencies 16 DEPS='gsl' 17 18 ## Flags 19 INCS=`pkg-config --cflags ${DEPS}` 20 LIBS=`pkg-config --libs ${DEPS}` 21 DEBUG= #'-g' 22 STANDARD=-std=c99 23 WARNINGS=-Wall 24 FAST=-Ofast 25 ## Formatter 26 STYLE_BLUEPRINT=webkit 27 FORMATTER=clang-format -i -style=$(STYLE_BLUEPRINT) 28 29 ## make build 30 build: $(SRC) 31 $(CC) $(DEBUG) $(INCS) $(PLUGS) $(SRC) -o samples $(LIBS) 32 33 fast: $(SRC) 34 $(CC) $(FAST) $(DEBUG) $(INCS) $(PLUGS) $(SRC) -o samples $(LIBS) 35 36 format: $(SRC) 37 $(FORMATTER) $(SRC) 38 39 run: $(SRC) $(OUTPUT) 40 echo "Increasing stack size limit, because we are dealing with 1M samples" 41 # ulimit: increase stack size limit 42 # -Ss: the soft limit. If you set the hard limit, you then can't raise it 43 # 256000: around 250Mbs, if I'm reading it correctly. 44 # Then run the program 45 ulimit -Ss 256000 && ./$(OUTPUT) 46 47 48 49 # Old: 50 # Link libraries, for good measure 51 # LD_LIBRARY_PATH=/usr/local/lib 52 # export LD_LIBRARY_PATH 53