Coming back to using Swift after 5 Years :) - probably forgotten everything, so treat me as a newbie.

I had written a CLI-App compiled in a Terminal using make and gcc. flex() (lex) is being used and the Makefile carries the rules to build the binary from the lex file (extension .l).

The problem - and that's why I'm turning to XCode/Swift - is, I have to access the pasteboard server (someone told me):

@interface NSPasteboard : NSObject

The Xcode framework created a skeleton "hello world" kind of app.

Now I need to know how I can add the logic that's in the Makefile into my project.

Actually, the main() is in the flex parser source file.

The project creates a main.swift. From within this main.swift I would have to call the .c-file that's generated using

    lex.yy.c:   my.l
                flex -8 ${LEXCOMPAT} my.l

So I have to create a dependency, that lex.yy.c is generated first, before compiling the main.swift.

Any help appreciated.

--
Christoph