41 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
| # Copyright (c) 2025 Jacob Eva (Liberated Embedded Systems)
 | |
| # This program is free software: you can redistribute it and/or modify it
 | |
| # under the terms of the GNU General Public License as published by the Free
 | |
| # Software Foundation, either version 3 of the License, or (at your option)
 | |
| # any later version.
 | |
| # This program is distributed in the hope that it will be useful, but WITHOUT
 | |
| # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 | |
| # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
 | |
| # more details.
 | |
| # You should have received a copy of the GNU General Public License along
 | |
| # with this program. If not, see <https://www.gnu.org/licenses/>.
 | |
| 
 | |
| # This makefile is for GNU / Linux.
 | |
| 
 | |
| CC=gcc
 | |
| FLAGS=-DLOG_USE_COLOR -l crypto
 | |
| LIB=librnode
 | |
| SRCS=$(shell find src ! -name '*win32.c' -name '*.c' -type f)
 | |
| OBJS=$(patsubst %.c,%.o,$(SRCS))
 | |
| F_OBJS=$(notdir $(OBJS))
 | |
| 
 | |
| all: $(OBJS)
 | |
| 	ar cr build/$(LIB).a -o $(F_OBJS)
 | |
| 	mv *.o build
 | |
| 
 | |
| %.o: %.c
 | |
| 	$(CC) $(FLAGS) $< -c
 | |
| 
 | |
| debug: FLAGS+=-g
 | |
| debug: all
 | |
| 
 | |
| test: all
 | |
| 	$(CC) tests/test.c -L build -l rnode -l tap -l crypto -l md -o build/librnode_test
 | |
| 
 | |
| test-debug: debug
 | |
| 	$(CC) tests/test.c -L build -l rnode -l tap -l crypto -l md -g -o build/librnode_test
 | |
| 
 | |
| clean:
 | |
| 	- rm -rf build
 | |
| 	- mkdir build
 |