about summary refs log blame commit diff stats
path: root/Makefile
blob: d95ed9997285840fb510c4405bcf809d60c1aa82 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
         

                           
 
           
                                                                                                                                                                                                                               
 
                        

                                                                                                                                         
                        

                                                                                                                                     
                      

                                                                                                                                             
                      

                                                                                                                                         
                    

                                                                                       
                    

                                                                                          
                       

                                                                                                                                                                                            
                         

                                                                                                                                                                                                                              
                       

                                                                                                                                                                                        


                                                                                                                                                                                                                                     
                         

                                                                                                                                                                                                                              
                            

                                                                                                                                                                                                              
                        

                                                                                                                                                                                           
                            

                                                                                                                                                                                                            
                        




                                                                                                                                                                                                                   
             
      
                                
 
           

                             
 
           

                                                                                
 
CC := c99
CFLAGS := -Wall -Wextra -O2
DEP := numericx.c

.PHONY: all
all: decimal-to-earth earth-to-decimal decimal-to-sun sun-to-decimal decimal-to-lori decimal-to-nonal_inf decimal-to-nonal lori-to-decimal nonal_inf-to-decimal nonal-to-decimal uninfinity decimal-to-binary binary-to-decimal

decimal-to-earth: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"12345\" -o $@ $^

earth-to-decimal: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"12345\" -DTO_NUMERICALS=\"0123456789\" -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -o $@ $^

decimal-to-sun: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"123456789\" -o $@ $^

sun-to-decimal: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"123456789\" -DTO_NUMERICALS=\"0123456789\" -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -o $@ $^

sun-to-earth: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"123456789\" -DTO_NUMERICALS=\"12345\" $@ $^

earth-to-sun: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"12345\" -DTO_NUMERICALS=\"123456789\" -o $@ $^

decimal-to-lori: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_UNITS_ON_THE_END -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"123456789@\" -DTO_UNITS_ON_THE_END -o $@ $^

decimal-to-binary: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_UNITS_ON_THE_END -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"01\" -DTO_UNITS_ON_THE_END -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -o $@ $^

lori-to-decimal: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"123456789@\" -DFROM_UNITS_ON_THE_END -DTO_NUMERICALS=\"0123456789\" -DTO_UNITS_ON_THE_END -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -o $@ $^

nonal-decimal: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"123456789\" -DFROM_UNITS_ON_THE_END -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"0123456789\" -DTO_UNITS_ON_THE_END -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -o $@ $^

binary-to-decimal: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"01\" -DFROM_UNITS_ON_THE_END -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"0123456789\" -DTO_UNITS_ON_THE_END -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -o $@ $^

decimal-to-nonal_inf: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_UNITS_ON_THE_END -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"123456789\" -DTO_UNITS_ON_THE_END -DTO_INFINITE_BASE -o $@ $^

decimal-to-nonal: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_UNITS_ON_THE_END -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"123456789\" -DTO_UNITS_ON_THE_END -o $@ $^

nonal_inf-to-decimal: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"123456789\" -DFROM_UNITS_ON_THE_END -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"0123456789\" -DTO_UNITS_ON_THE_END -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -o $@ $^

nonal-to-decimal: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"123456789\" -DFROM_UNITS_ON_THE_END -DTO_NUMERICALS=\"0123456789\" -DTO_UNITS_ON_THE_END -DTO_FIRST_NUMBER_VOID -DTO_INFINITE_BASE -o $@ $^

uninfinity: $(DEP)
	$(CC) $(CFLAGS) -DFROM_NUMERICALS=\"0123456789\" -DFROM_UNITS_ON_THE_END -DFROM_FIRST_NUMBER_VOID -DFROM_INFINITE_BASE -DTO_NUMERICALS=\"0123456789\" -DTO_UNITS_ON_THE_END -DTO_FIRST_NUMBER_VOID -o $@ $^

.PHONY: clean
clean:
	\rm -f *-to-* uninfinity

.PHONY: run
run: decimal-to-earth
	./decimal-to-earth 21

.PHONY: mem
mem: decimal-to-earth
	valgrind --leak-check=full --show-leak-kinds=all -s decimal-to-earth 999