I was at work and i turned around and this really cute guy was looking at me like this: I didn't get a chance to talk to him. Could it mean he wanted attention or was making fun of me?
Figure out a way to talk to him! Even if it's just asking if you can get him some coffee or how his weekend was. Then you'll be able to gauge how he feels about you.
He could be being friendly. Whatever the case, it wasn't negative. I sometimes smile/grin at strangers because I never know if the person I'm walking past may need some positivity in their life, and that's the least awkward way I can think of doing it.
I smile at everyone at work like that tbh. People I've never seen before too. That being said he could definitely be interested. Prolonged eye contact is in my experience the best indicator though.
Grin back at him and see how he reacts. If he likes it just say hi and start a conversation. It doesn't matter if he likes you or not, it's always pleasant to have a friendly face at work.
Think of it as an invitation to have a conversation with him. Whether it was a friendly intention or not, you'll find out.