[test/Makefile] Auto-generate .gitignore for test executables
This commit is contained in:
@@ -11,7 +11,7 @@ xotests = wiringpi_xotest_test1_spi wiringpi_i2c_test1_pcf8574 wiringpi_test8_pw
|
|||||||
# Need PiFace hardware and BCM23 <-> BCM24 , BCM18 <-> BCM17 connected (1kOhm), and PiFace Out7<->In4, Out6<->In5, R0_NO<->In6, R0_NO<->In7, R_C<-100Ohm->GND
|
# Need PiFace hardware and BCM23 <-> BCM24 , BCM18 <-> BCM17 connected (1kOhm), and PiFace Out7<->In4, Out6<->In5, R0_NO<->In6, R0_NO<->In7, R_C<-100Ohm->GND
|
||||||
pifacetests = wiringpi_piface_test1 wiringpi_test8_pwm wiringpi_test9_pwm
|
pifacetests = wiringpi_piface_test1 wiringpi_test8_pwm wiringpi_test9_pwm
|
||||||
|
|
||||||
all: $(tests) $(xotests) $(pifacetests)
|
all: $(tests) $(xotests) $(pifacetests) .gitignore
|
||||||
|
|
||||||
wiringpi_test0_version:
|
wiringpi_test0_version:
|
||||||
${CC} ${CFLAGS} wiringpi_test0_version.c -o wiringpi_test0_version -lwiringPi
|
${CC} ${CFLAGS} wiringpi_test0_version.c -o wiringpi_test0_version -lwiringPi
|
||||||
@@ -113,7 +113,23 @@ pifacetest:
|
|||||||
echo "\n\e[5mPIFACE TEST SUCCESS\e[0m\n"; \
|
echo "\n\e[5mPIFACE TEST SUCCESS\e[0m\n"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Add all binaries to a folder-local .gitignore file
|
||||||
|
.gitignore:
|
||||||
|
@echo "Updating test directory .gitignore..."
|
||||||
|
@if ! test -f "./.gitignore"; then \
|
||||||
|
echo "# This file is automatically generated by make." >> .gitignore; \
|
||||||
|
echo "# Git will ignore this file and all generated WiringPi test binaries in this folder." >> .gitignore; \
|
||||||
|
echo "/.gitignore" >> .gitignore; \
|
||||||
|
fi
|
||||||
|
@for t in $(tests) $(xotests) $(pifacetests) ; do \
|
||||||
|
if ! grep -q "/$$t" .gitignore; then \
|
||||||
|
echo "/$$t" >> .gitignore; \
|
||||||
|
echo "Added /$$t to .gitignore"; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
for t in $(tests) $(xotests) $(pifacetests) ; do \
|
for t in $(tests) $(xotests) $(pifacetests) ; do \
|
||||||
rm -fv $${t} ; \
|
rm -fv $${t} ; \
|
||||||
done
|
done
|
||||||
|
rm -fv .gitignore
|
||||||
|
|||||||
Reference in New Issue
Block a user