Engineering is the study and practice of problem analysis and design synthesis. Whether that means using abstractions of the physical world or how data is structured and processed is unimportant.
Any approach to the understanding of problems and how to solve them is engineering. Sometimes it's very structured, sometimes it deals with the physical world - and other times it's incredibly abstract and divorced from the real world. It's all engineering.
Engineering is the creation and ongoing management of any real world object (building, cars, bridge, computer) which has affect on its environment. I.e. they are placed in the real world to achieve some sort of a function.
The role of the engineer is:
1) Find out what function a machine should provide
2) Create this function by building the artifact on time, and in cost effective manner.
An artist on the other hand:
1) Does not care about the function. I.e. if the thing is useful or not.
2) Does not care about the time/cost etc.
The fact that software is just a description (bunch of text files), does not mean that it does not affect the real world.
As I said, the machine in the real world is the general propose computer. The computer understand this text files, and turn itself into the machine.
Mechanical engineering is a little more removed. You have moving parts, interconnected pieces, wear and tear, etc. Now you have to lean heavily on preventative maintenance, ability to replace worn parts, etc.
Hardware is more removed. Software is even more removed. The laws of physics are there, but there are so many man-made layers of abstractions on top of it that "good architecture" is a lot less like what you'd expect in a typical engineering discipline.
Not saying any is easier than the other, just that they are very different disciplines.