#!/bin/bash

function remove_oldversion_wiringPi() {
    # old version wiringNP
    rm -f ${1}/usr/local/include/ds1302.h
    rm -f ${1}/usr/local/include/maxdetect.h
    rm -f ${1}/usr/local/include/piNes.h
    rm -f ${1}/usr/local/include/gertboard.h
    rm -f ${1}/usr/local/include/piFace.h
    rm -f ${1}/usr/local/include/lcd128x64.h
    rm -f ${1}/usr/local/include/lcd.h
    rm -f ${1}/usr/local/include/piGlow.h
    rm -f ${1}/usr/local/lib/libwiringPiDev.*
    rm -f ${1}/usr//lib/libwiringPiDev.so

    rm -f ${1}/usr/local/include/wiringPi.h
    rm -f ${1}/usr/local/include/boardtype_friendlyelec.h
    rm -f ${1}/usr/local/include/wiringSerial.h
    rm -f ${1}/usr/local/include/wiringShift.h
    rm -f ${1}/usr/local/include/softPwm.h
    rm -f ${1}/usr/local/include/softTone.h
    rm -f ${1}/usr/local/include/softServo.h
    rm -f ${1}/usr/local/include/wiringPiSPI.h
    rm -f ${1}/usr/local/include/wiringPiI2C.h
    rm -f ${1}/usr/local/include/drcSerial.h
    rm -f ${1}/usr/local/include/mcp23008.h
    rm -f ${1}/usr/local/include/mcp23016.h
    rm -f ${1}/usr/local/include/mcp23017.h
    rm -f ${1}/usr/local/include/mcp23s08.h
    rm -f ${1}/usr/local/include/mcp23s17.h
    rm -f ${1}/usr/local/include/max31855.h
    rm -f ${1}/usr/local/include/max5322.h
    rm -f ${1}/usr/local/include/mcp3002.h
    rm -f ${1}/usr/local/include/mcp3004.h
    rm -f ${1}/usr/local/include/mcp4802.h
    rm -f ${1}/usr/local/include/mcp3422.h
    rm -f ${1}/usr/local/include/sr595.h
    rm -f ${1}/usr/local/include/pcf8574.h
    rm -f ${1}/usr/local/include/pcf8591.h
    rm -f ${1}/usr/local/include/sn3218.h
    rm -f ${1}/usr/local/lib/libwiringPi.*
    rm -f ${1}/usr/lib/libwiringPi.so

    rm -f ${1}/usr/local/bin/gpio
    rm -f ${1}/usr/local/man/man1/gpio.1
}

remove_oldversion_wiringPi /
