Results 1 to 10 of 10

Thread: linking user space and kernel space programs with qmake

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: linking user space and kernel space programs with qmake

    Quote Originally Posted by zielchri
    I guess I always thought "RT_DAQ:RT_DAQ.c RT_user" was how the two files got linked together. Is this wrong?
    Yes, it is. That's only a rule that tells the make program that the "RT_DAQ" target depends on "RT_DAQ.c" and "RT_user" (i.e. it states that if one of them has been changed the RT_DAQ should be rebuilt).

    Since you are building two separate things, you could use the subdir template:

    Suppose your project directory has following layout:
    ./rt.pro
    ./frontend/rt_user.pro
    ./frontend/RT_user.cpp
    ./module/Makefile
    ./module/RT_DAQ.c
    Where rt.pro is:
    Qt Code:
    1. TEMPLATE = subdirs
    2. SUBDIRS += frontend module
    To copy to clipboard, switch view to plain text mode 

    ./frontend/rt_user.pro is:
    Qt Code:
    1. TEMPLATE = app
    2. TARGET = ../bin/rt_client
    3. MOC_DIR = ../build
    4. OBJECTS_DIR = ../build
    5. INCLUDEPATH += /usr/src/linux/include \
    6. /usr/realtime/include \
    7. /devel/comedi-0.7.68/include \
    8. /opt/kde3/include
    9. LIBS += -L/opt/kde3/lib -lkdeui -lkdecore \
    10. -L/devel/comedi-0.7.68/lib -lcomedi
    11. SOURCES += RT_user.cpp
    To copy to clipboard, switch view to plain text mode 

    and ./module/Makefile is:
    Qt Code:
    1. LINUXINC= /usr/src/linux/include
    2. RTAIINC= /usr/realtime/include
    3. COMEDIDIR= /devel/comedi-0.7.68/include
    4. FLAGS=-g -D__KERNEL__ -DMODULE -O2
    5. INCLD= -I$(LINUXINC) -I$(RTAIINC) -I/usr/include
    6.  
    7. RT_DAQ: RT_DAQ.c
    8. gcc -c $(FLAGS) $(INCLD) -I$(COMEDIDIR) RT_DAQ.c
    To copy to clipboard, switch view to plain text mode 

    If all paths are correct and I haven't forgot anything it should build without any problems.
    Last edited by jacek; 8th March 2006 at 21:40.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.