PPI: Checkin of first compiling (yet not working) version
[senf.git] / Packets / SConscript
index f322d3d..153a67c 100644 (file)
@@ -1,9 +1,32 @@
+# -*- python -*-
+
 Import('env')
-import SatSCons
+import SENFSCons, glob
 
 ###########################################################################
 
-sources = SatSCons.GlobSources()
-SatSCons.StandardTargets(env)
-SatSCons.Lib(env, 'Packets',  sources)
-SatSCons.Doxygen(env,sources)
+def makeAllIncludesHH(target = None, source = None, env = None):
+    file(target[0].abspath,"w").write("".join([ '#include "%s"\n' % f
+                                                for f in env['SOURCE_HEADERS']]))
+makeAllIncludesHH = env.Action(makeAllIncludesHH, varlist=['SOURCE_HEADERS'])
+
+###########################################################################
+
+sources = SENFSCons.GlobSources()
+
+SENFSCons.StandardTargets(env)
+
+env.Command('all_includes.hh', 'SConscript', makeAllIncludesHH,
+            SOURCE_HEADERS = [ f for f in glob.glob("*.hh")
+                               if 'defined(SENF_PACKETS_DECL_ONLY)' in file(f).read() ])
+
+SENFSCons.Lib(env,
+              library = 'Packets',
+              sources = sources,
+              LIBS = [ 'Socket', 'Utils' ])
+
+SENFSCons.Doxygen(env, extra_sources = [
+    env.Dia2Png("structure.dia")
+])
+
+SConscript(glob.glob("*/SConscript"))