July 2015
Intermediate to advanced
380 pages
10h 15m
English
Im going to use the RingBuffer to create a very simplistic network testing tool that I call netclient. To do this, I have to add some stuff to the Makefile to handle little programs in the bin/ directory.
First, add a variable for the programs just like the unit test’s TESTS and TEST_SRC variables:
PROGRAMS_SRC=$(wildcard bin/*.c) PROGRAMS=$(patsubst %.c,%,$(PROGRAMS_SRC))
Then, you want to add the PROGRAMS to the all target:
all: $(TARGET) $(SO_TARGET) tests $(PROGRAMS)
Then, add PROGRAMS to the rm line in the clean target:
rm –rf build $(OBJECTS) $(TESTS) $(PROGRAMS)
Finally, you just need a target ...