summaryrefslogblamecommitdiffstats
path: root/Makefile
blob: 3127871541e0986b8c0085b0f864f90ff33e48bf (plain) (tree)
1
2
3
4
5
6

                
          
   

                                                                                                                                    














                                                                                                                                                                                               
                                         

          
                        

      
                        

        
                                                       
 
                                   


                                       
                                                                                 
DESTDIR=/
SRCFILE=main.cpp
BINFILE=ov
O=0
CFLAGS += -Wextra -Wall -g -O$O -I. -o$(BINFILE) -finput-charset=UTF-8 -fextended-identifiers $(shell pkg-config muparserx --cflags)
LIBS += $(shell pkg-config muparserx --libs)
CC=c++
VGARGS += --leak-check=full --track-origins=yes --verbose --log-file=valgrind-out.txt --suppressions=/usr/lib/i386-linux-gnu/valgrind/default.supp --show-leak-kinds=all --leak-resolution=high

.NOTPARALLEL:
default:
	$(CC) $(CFLAGS) $(SRCFILE) $(LIBS)

# tests if code compiles under gcc, clang and tcc
cc:
	make -e CC=tcc
	make -e CC=gcc
	make -e CC=clang

install:
	mkdir -p $(DESTDIR)/usr/bin/
	cp $(BINFILE) $(DESTDIR)/usr/bin/

distclean:
	rm $(BINFILE) -f

clean:
	rm $(BINFILE) -f
	
prepare:
	apt install build-essential libmuparserx-dev -y

# developing is to be done on i386.
# developing is to be done on bullseye.

valgrind:
	G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind $(VGARGS) ./$(BINFILE)