
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:
TEMPLATE = subdirs
SUBDIRS += frontend module
TEMPLATE = subdirs
SUBDIRS += frontend module
To copy to clipboard, switch view to plain text mode
./frontend/rt_user.pro is:
TEMPLATE = app
TARGET = ../bin/rt_client
MOC_DIR = ../build
OBJECTS_DIR = ../build
INCLUDEPATH += /usr/src/linux/include \
/usr/realtime/include \
/devel/comedi-0.7.68/include \
/opt/kde3/include
LIBS += -L/opt/kde3/lib -lkdeui -lkdecore \
-L/devel/comedi-0.7.68/lib -lcomedi
SOURCES += RT_user.cpp
TEMPLATE = app
TARGET = ../bin/rt_client
MOC_DIR = ../build
OBJECTS_DIR = ../build
INCLUDEPATH += /usr/src/linux/include \
/usr/realtime/include \
/devel/comedi-0.7.68/include \
/opt/kde3/include
LIBS += -L/opt/kde3/lib -lkdeui -lkdecore \
-L/devel/comedi-0.7.68/lib -lcomedi
SOURCES += RT_user.cpp
To copy to clipboard, switch view to plain text mode
and ./module/Makefile is:
LINUXINC= /usr/src/linux/include
RTAIINC= /usr/realtime/include
COMEDIDIR= /devel/comedi-0.7.68/include
FLAGS=-g -D__KERNEL__ -DMODULE -O2
INCLD= -I$(LINUXINC) -I$(RTAIINC) -I/usr/include
RT_DAQ: RT_DAQ.c
gcc -c $(FLAGS) $(INCLD) -I$(COMEDIDIR) RT_DAQ.c
LINUXINC= /usr/src/linux/include
RTAIINC= /usr/realtime/include
COMEDIDIR= /devel/comedi-0.7.68/include
FLAGS=-g -D__KERNEL__ -DMODULE -O2
INCLD= -I$(LINUXINC) -I$(RTAIINC) -I/usr/include
RT_DAQ: RT_DAQ.c
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.
Bookmarks