PPI: Checkin of first compiling (yet not working) version
[senf.git] / Packets / SConscript
index 9db975b..153a67c 100644 (file)
@@ -1,13 +1,32 @@
 # -*- python -*-
 
 Import('env')
-import SENFSCons
+import SENFSCons, glob
+
+###########################################################################
+
+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)
-SENFSCons.Lib(env, 'Packets',  sources, )
+
+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"))