Commit 066135eb authored by Christoffer Ackelman's avatar Christoffer Ackelman

Prepared build script for a QT version.

I have finally conquered the horror that is make.
parent 845ecf78
......@@ -74,14 +74,14 @@ ename=$ver$hw
desc=$verl
gui="qt"
pwre add $ename $root/src \"\" $root/rls $btype $os $hw $gui "$desc"
pwre add $ename $root/src \"\" $root/rls $btype $os $hw "$desc"
pwre init $ename
# Build
mkdir -p $pwre_broot
pwre configure
pwre create_all_modules
pwre build_all_modules
pwre build_all_modules $gui
# Create a package version html file
$root/src/tools/pkg/deb/pwrrt/build.sh -v
......
......@@ -41,6 +41,7 @@ endif
vpath %.c $(hw_source):$(os_source):$(co_source)
vpath %.cpp $(hw_source):$(os_source):$(co_source)
vpath %.cqt $(hw_source):$(os_source):$(co_source)
vpath %.l $(hw_source):$(os_source):$(co_source)
vpath %.h $(hw_source):$(os_source):$(co_source)
vpath %.hpp $(hw_source):$(os_source):$(co_source)
......@@ -51,7 +52,16 @@ c_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.c $(dir)/*.cpp) \
$(wildcard $(dir)/*.c $(dir)/*.cpp $(dir)/*.cqt) \
), $(notdir $(file)) \
) \
)
cqt_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.cqt) \
), $(notdir $(file)) \
) \
)
......@@ -104,7 +114,11 @@ export_includes := $(addprefix $(inc_dir)/,$(h_includes) $(hpp_includes))
l_targets := $(addprefix $(bld_dir)/,$(basename $(l_sources)))
l_targets := $(addsuffix $(c_ext),$(l_targets))
cqt_objects := $(patsubst %.cqt, %_moc.o, $(cqt_sources))
cqt_objects := $(addprefix $(bld_dir)/,$(basename $(cqt_objects)))
objects := $(addprefix $(bld_dir)/,$(basename $(c_sources)))
objects += $(cqt_objects)
objects += $(addprefix $(bld_dir)/,$(basename $(l_sources)))
objects := $(strip $(addsuffix $(obj_ext),$(objects)))
......
......@@ -112,19 +112,15 @@ pre_so =
# linkgtk :=
#endif
#ifeq ($(pwre_conf_qt),1)
# cqt := -DPWRE_CONF_QT=1
# linkqt := `pkg-config --libs QtCore QtGui`
#else
# cqt :=
# linkqt :=
#endif
log_done =
#csetos := -DOS_LINUX=1 -DOS=linux -D_LINUX -DHW_ARM=1 -DHW=ARM
#cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I$(jdk)/include -I$(jdk)/include/linux
csetos := $(pwre_conf_cc_define)
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirgtk) $(pwre_conf_incdirgst) $(pwre_conf_incdirgtk)
ifeq ($(flavour),gtk)
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirgtk) $(pwre_conf_incdirgst)
else
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirqt)
endif
rm := rm
cp := cp
cpflags :=
......
......@@ -112,14 +112,6 @@ pre_so =
# linkgtk :=
#endif
#ifeq ($(pwre_conf_qt),1)
# cqt := -DPWRE_CONF_QT=1
# linkqt := `pkg-config --libs QtCore QtGui`
#else
# cqt :=
# linkqt :=
#endif
#ifeq ($(pwre_conf_libusb),1)
# clibusb := -DPWRE_CONF_LIBUSB=1
# linklibusb := -lusb-1.0
......@@ -133,7 +125,11 @@ log_done =
#cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux \
`pkg-config --cflags gtk+-2.0` -DPREFIX=\"/usr/local\" -DSYSCONFDIR=\"/etc\" -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" $(cmysql) $(cgtk) $(clibusb)
csetos := $(pwre_conf_cc_define)
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirgtk) $(pwre_conf_incdirgst) $(pwre_conf_incdirqt)
ifeq ($(flavour),gtk)
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirgtk) $(pwre_conf_incdirgst)
else
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirqt)
endif
rm := rm
cp := cp
cpflags :=
......
......@@ -111,14 +111,6 @@ linkcp = :
# linkgtk :=
#endif
#ifeq ($(pwre_conf_qt),1)
# cqt := -DPWRE_CONF_QT=1
# linkqt := `pkg-config --libs QtCore QtGui`
#else
# cqt :=
# linkqt :=
#endif
#ifeq ($(pwre_conf_libusb),1)
# clibusb := -DPWRE_CONF_LIBUSB=1
# linklibusb := -lusb-1.0
......@@ -132,7 +124,11 @@ log_done =
#cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) -I/usr/X11R6/include -I$(jdk)/include -I$(jdk)/include/linux \
`pkg-config --cflags gtk+-2.0` -DPREFIX=\"/usr/local\" -DSYSCONFDIR=\"/etc\" -DDATADIR=\"/usr/share\" -DLIBDIR=\"/usr/lib\" $(cmysql) $(cgtk) $(clibusb)
csetos := $(pwre_conf_cc_define)
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirgtk) $(pwre_conf_incdirgst) $(pwre_conf_incdirqt)
ifeq ($(flavour),gtk)
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirgtk) $(pwre_conf_incdirgst)
else
cinc := -I$(inc_dir) -I$(einc_dir) -I$(hw_source) -I$(os_source) -I$(co_source) $(pwre_conf_incdir) $(pwre_conf_incdirqt)
endif
rm := rm
cp := cp
cpflags :=
......
......@@ -35,6 +35,7 @@ vpath %.h $(hw_source):$(os_source):$(co_source)
vpath %.hpp $(hw_source):$(os_source):$(co_source)
vpath %.c $(hw_source):$(os_source):$(co_source)
vpath %.cpp $(hw_source):$(os_source):$(co_source)
vpath %.cqt $(hw_source):$(os_source):$(co_source)
vpath %.x $(hw_source):$(os_source):$(co_source)
vpath %.pdr $(hw_source):$(os_source):$(co_source)
vpath %.java $(hw_source):$(os_source):$(co_source)
......@@ -47,7 +48,16 @@ sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/$(comp_name)*.c $(dir)/$(comp_name)*.cpp) \
$(wildcard $(dir)/$(comp_name)*.c $(dir)/$(comp_name)*.cpp $(dir)/$(comp_name)*.cqt) \
), $(notdir $(file)) \
) \
)
cqt_sources := $(sort \
$(foreach file, \
$(foreach dir, \
$(source_dirs), \
$(wildcard $(dir)/*.cqt) \
), $(notdir $(file)) \
) \
)
......@@ -115,6 +125,8 @@ meth_sources := $(sort \
) \
)
cqt_objects := $(patsubst %.cqt, %_moc.o, $(cqt_sources))
xdr_includes := $(addprefix $(inc_dir)/,$(patsubst %.x, %.h, $(xdr_sources)))
xdr_objects := $(patsubst %.x, %_xdr.o, $(xdr_sources))
......@@ -141,6 +153,7 @@ export_lib := $(lib_dir)/$(lib_name)$(lib_ext)
java_classes := $(addsuffix .class, $(basename $(java_sources)))
objects := $(addsuffix $(obj_ext), $(basename $(sources)))
objects += $(xdr_objects) $(pdr_objects)
objects += $(cqt_objects)
objects += $(java_classes)
objects := $(addprefix $(bld_dir)/, $(objects))
......
......@@ -102,6 +102,21 @@ endif
@ $(log_c_obj)
@ $(cxx) $(cxxflags) $(csetos) $(cinc) $(cobj) $(source)
$(bld_dir)/%.o : %.cqt
ifeq ($(nodep),)
@ $(log_c_d)
@ $(SHELL) -ec '$(cxx) -x c++ -MM $(csetos) $(mmflags) $(cinc) $(source) \
| sed '\''s|$*\.o[ ]*|$(bld_dir)/&|g'\'' > $(bld_dir)/$(sname).d'
endif
@ echo "Generating ../../$(sname)_moc.cpp from ../../$(sname).h using moc"
@ moc $(csetos) $(cinc) ../../$(sname).h \
-o $(bld_dir)/$(sname)_moc.cpp
@ echo "Compiling ../../$(sname)_moc.cpp"
@ $(cxx) $(cxxflags) $(csetos) $(cinc) -o $(bld_dir)/$(sname)_moc.o $(bld_dir)/$(sname)_moc.cpp
@ $(cp) $(source) $(bld_dir)/$(sname).cpp
@ $(log_c_obj)
@ $(cxx) $(cxxflags) $(csetos) $(cinc) $(cobj) $(bld_dir)/$(sname).cpp
$(bld_dir)/%.o : $(tmp_dir)/%.cpp
ifeq ($(nodep),)
......@@ -122,6 +137,21 @@ endif
@ $(log_c_obj)
@ $(cxx) $(cxxflags) $(csetos) $(cinc) $(cobj) $(source)
$(obj_dir)/%.o : %.cqt
ifeq ($(nodep),)
@ $(log_c_d)
@ $(SHELL) -ec '$(cxx) -x c++ -MM $(cinc) $(csetos) $(mmflags) $(source) \
| sed '\''s|$*\.o[ ]*|$(obj_dir)/&|g'\'' > $(obj_dir)/$(sname).d'
endif
@ echo "Generating ../../$(sname)_moc.cpp from ../../$(sname).h using moc"
@ moc $(csetos) $(cinc) ../../$(sname).h \
-o $(bld_dir)/$(sname)_moc.cpp
@ echo "Compiling ../../$(sname)_moc.cpp"
@ $(cxx) $(cxxflags) $(csetos) $(cinc) -o $(bld_dir)/$(sname)_moc.o $(bld_dir)/$(sname)_moc.cpp
@ $(cp) $(source) $(bld_dir)/$(sname).cpp
@ $(log_c_obj)
@ $(cxx) $(cxxflags) $(csetos) $(cinc) $(cobj) $(bld_dir)/$(sname).cpp
$(inc_dir)/%.h : %.x
@ $(log_x_h)
......@@ -169,14 +199,6 @@ endif
(%.o) : %.o
@ echo "Error, rule shall not be used: (%.o) : %.o"
$(inc_dir)/%_qt.h : %_qt.h
# @ (>&2 echo "moc $(csetos) $(cinc) -o $<.moc.cpp $<")
@ moc -nw $(csetos) $(cinc) -o $<.moc.cpp $<
# if [ ! -s $<.moc.cpp ]; then rm $<.moc.cpp; fi;
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
@ chmod u+w $(target)
$(inc_dir)/%.h : %.h
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
......
......@@ -45,7 +45,6 @@ $vmsinc = "";
$broot = "/usr/users/$user/$user" . "_dbg";
$btype = "dbg";
$os = "linux";
$gui = "qt";
if ($ENV{"pwre_hosttype"} eq "rs6000") {
$hw = "ppc";
} else {
......@@ -1659,17 +1658,12 @@ sub get_vars ()
$hw = $_[6];
}
if ($_[7] eq "") {
$gui = get_var(" Graphical User Interface [%s]? ", $gui);
} else {
$gui = $_[7];
}
if ($_[8] eq "") {
$desc = get_var(" Description [%s]? ", $desc);
} else {
$desc = $_[8];
$desc = $_[7];
}
$varstr = join(";", ($sroot, $vmsinc, $broot, $btype, $os, $hw, $gui, $desc));
$varstr = join(";", ($sroot, $vmsinc, $broot, $btype, $os, $hw, $desc));
}
......@@ -1690,8 +1684,8 @@ sub get_var()
sub read_vars ()
{
$varstr = $envdb{$label};
($sroot, $vmsinc, $broot, $btype, $os, $hw, $gui, $desc) = split(/;/, $varstr);
@vars = ($sroot, $vmsinc, $broot, $btype, $os, $hw, $gui, $desc);
($sroot, $vmsinc, $broot, $btype, $os, $hw, $desc) = split(/;/, $varstr);
@vars = ($sroot, $vmsinc, $broot, $btype, $os, $hw, $desc);
}
......@@ -1709,7 +1703,6 @@ sub show_vars ()
printf("-- Build type.....: %s\n", $btype);
printf("-- OS.............: %s\n", $os);
printf("-- Hardware.......: %s\n", $hw);
printf("-- Graphical user interface.......: %s\n", $gui);
printf("-- Description....: %s\n", $desc);
}
......
......@@ -391,15 +391,14 @@ echo "export PWRE_CONF_LOCKDBS=$lockdbs" >> $cfile
if [ $pwre_hw == "hw_arm" ] && [ $ebuild -eq 1 ]; then
echo "Arm ebuild"
if [ $pwre_gui == "qt" ]; then
pwre_config_check_include qt QT 1 "/usr/include/qt4/Qt/QtCore"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtCore/QtCore"
pwre_config_check_include qt QT 1 "/usr/include/qt4/Qt/QtGui"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui"
elif [ $pwre_gui == "gtk" ]; then
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so"
if [ $pwre_conf_qt -eq 1 ]; then
pwre_config_check_lib qt QT qt qt 0 "/usr/lib/libQtGui.so:/usr/lib/$hwpl-linux-$gnu/libQtGui.so"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui"
else
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so"
pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h"
fi
pwre_config_check_include jni JNI 1 $jdk/include/jni.h
pwre_config_check_include jni JNI 0 $jdk/include/linux/jni_md.h
......@@ -462,11 +461,10 @@ else
#Gtk
echo "Mandatory :"
echo "$pwre_gui"
if [ $pwre_gui == "qt" ]; then
pwre_config_check_lib qt QT qt qt 0 "/usr/lib/$hwpl-linux-$gnu/libQtGui.so"
elif [ $pwre_gui == "gtk" ]; then
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so"
if [ $pwre_conf_qt -eq 1 ]; then
pwre_config_check_lib qt QT qt qt 0 "/usr/lib/libQtGui.so:/usr/lib/$hwpl-linux-$gnu/libQtGui.so"
else
pwre_config_check_lib gtk GTK gtk gtk 0 "/usr/lib/libgtk-x11-2.0.so:/usr/lib/$hwpl-linux-$gnu/libgtk-x11-2.0.so"
fi
pwre_config_check_lib librpcsvc LIBRPCSVC lib lib 0 "/usr/lib/librpcsvc.so:/usr/lib/librpcsvc.a:/usr/lib/$hwpl-linux-$gnu/librpcsvc.a"
......@@ -481,15 +479,11 @@ else
pwre_config_check_lib libfl LIBFL lib lib 0 "/usr/lib/libfl.so:/usr/lib/libfl.a:/usr/lib/$hwpl-linux-$gnu/libfl.so"
pwre_config_check_lib libX11 LIBX11 lib lib 0 "/usr/lib/libX11.so:/usr/lib/$hwpl-linux-$gnu/libX11.so"
if [ $pwre_gui == "qt" ]; then
pwre_config_check_include qt QT 1 "/usr/include/qt4/Qt/QtCore"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtCore/QtCore"
pwre_config_check_include qt QT 1 "/usr/include/qt4/Qt/QtGui"
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui"
elif [ $pwre_gui == "gtk" ]; then
if [ $pwre_conf_qt -eq 1 ]; then
pwre_config_check_include qt QT 1 "/usr/include/qt4/QtGui/QtGui"
else
pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h"
fi
pwre_config_check_include alsa ALSA 1 "/usr/include/alsa/asoundlib.h"
echo ""
......
......@@ -11,7 +11,6 @@
# $pwre_bmodule Module name in build tree, eg. 'ssabox'
# $pwre_os Operating system, eg. 'os_linux'
# $pwre_hw Hardware, eg. 'hw_x86'
# $pwre_gui Graphical User Interface, eg. 'qt', 'gtk' or 'motif'
# $pwr_exe Exe directory for module build root, eg. ssabox/exe
# $pwr_load Load directory for module build root
# $pwr_inc Inc directory for module build root
......@@ -69,7 +68,6 @@ set_env()
export pwre_btype="$4"
export pwre_os="os_$5"
export pwre_hw="hw_$6"
export pwre_gui="$7"
export pwre_target="$pwre_os/$pwre_hw"
export pwre_bin="$pwre_kroot/tools/pwre/src/$pwre_os"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment