We can use if [ -d filename ] to check if Dir..as shown below the code below checks and displays the results for file or dir in the home location of my folder..we call this script in the makefile as "./script"as i don't think it is feasible different cmds in a makefile...so this alternative..
#! /bin/bash file=/home/xenial-xerus/ #location of files and dir in my system..change for urs..
for i in `ls $file` #ls cmd will list a string of the names of all elements(files + Dir) in the given location do
if [ -d $file/$i ] #check for dir then echo "$i it is a directory" else #check for file echo "$i is a file" fi done