mirror of
				https://github.com/Zygo/bees.git
				synced 2025-11-03 19:50:34 +01:00 
			
		
		
		
	NamedPtr provides reference-counted handles to named objects. The object is created the first time the associated name is used, and stored under the associated name until the last handle is destroyed. NamedPtr may itself be destroyed while handles are still active. This template is intended to replace ResourceHandle with a more general and less invasive implementation. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
		
			
				
	
	
		
			45 lines
		
	
	
		
			812 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			45 lines
		
	
	
		
			812 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
PROGRAMS = \
 | 
						|
	chatter \
 | 
						|
	crc64 \
 | 
						|
	fd \
 | 
						|
	limits \
 | 
						|
	namedptr \
 | 
						|
	path \
 | 
						|
	process \
 | 
						|
	progress \
 | 
						|
	task \
 | 
						|
 | 
						|
all: test
 | 
						|
 | 
						|
test: $(PROGRAMS:%=%.txt) Makefile
 | 
						|
FORCE:
 | 
						|
 | 
						|
include ../makeflags
 | 
						|
 | 
						|
LIBS = -lcrucible -lpthread
 | 
						|
BEES_LDFLAGS = -L../lib $(LDFLAGS)
 | 
						|
 | 
						|
.depends:
 | 
						|
	mkdir -p $@
 | 
						|
 | 
						|
.depends/%.dep: %.cc tests.h Makefile | .depends
 | 
						|
	$(CXX) $(BEES_CXXFLAGS) -M -MF $@ -MT $(<:.cc=.o) $<
 | 
						|
 | 
						|
depends.mk: $(PROGRAMS:%=.depends/%.dep)
 | 
						|
	cat $^ > $@.new
 | 
						|
	mv -f $@.new $@
 | 
						|
 | 
						|
include depends.mk
 | 
						|
 | 
						|
$(PROGRAMS:%=%.o): %.o: %.cc ../makeflags Makefile
 | 
						|
	$(CXX) $(BEES_CXXFLAGS) -o $@ -c $<
 | 
						|
 | 
						|
$(PROGRAMS): %: %.o ../makeflags Makefile ../lib/libcrucible.a
 | 
						|
	$(CXX) $(BEES_CXXFLAGS) $(BEES_LDFLAGS) -o $@ $< $(LIBS)
 | 
						|
 | 
						|
%.txt: % Makefile FORCE
 | 
						|
	./$< >$@ 2>&1 || (RC=$$?; cat $@; exit $$RC)
 | 
						|
 | 
						|
clean:
 | 
						|
	rm -fv $(PROGRAMS:%=%.o) $(PROGRAMS:%=%.txt) $(PROGRAMS)
 |