Diff of /LIME-core/lib/main.mk [r22] .. [r23] Maximize Restore

  Switch to side-by-side view

--- a/LIME-core/lib/main.mk
+++ b/LIME-core/lib/main.mk
@@ -1,19 +1,9 @@
 ##################################################################
-#This file is part of LIME.
+# This mk file contains rules (no configuration or command defines)
+# that drive the LIME flow
 #
-#LIME is free software: you can redistribute it and/or modify
-#it under the terms of the GNU General Public License version 2
-#as published by the Free Software Foundation.
+#Copyright 2008 Pjotr Kourzanov
 #
-#LIME is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#GNU General Public License for more details.
-#
-#You should have received a copy of the GNU General Public License
-#along with LIME.  If not, see <http://www.gnu.org/licenses/>.
-##################################################################
-##################################################################
 #This file is part of LIME.
 #
 #LIME is free software: you can redistribute it and/or modify
@@ -36,7 +26,12 @@
 
 %.domains: %.c
 	$(inform)
-	$e$(call c2dom,$<) | $(uniq) >$@
+	$e(\
+		$(call c2dom,$<);\
+		for x in $(syshdr); do\
+			echo $$x | sed -ne 's,$(rinc)/\(.*\).h,\1,p';\
+		done;\
+	) | $(uniq) >$@
 
 # in case a component does not specify diversity,
 # just create an empty one
@@ -55,7 +50,9 @@
 	  	$(echo) "# Globally-set parameters as a default";\
 	  	$(awk) -vMODULE=$* -vFS="=" '/^#/ { next }\
 			{ split($$1,path,"[.]");\
-			  if (path[1] && MODULE ~ path[1]) print path[2] "=" $$2\
+			  if (!path[1]) next;\
+			  if (MODULE !~ path[1]) next;\
+			  print path[2] "=" $$2\
 			}' $(filter-out %.diversity,$^);\
 	  fi;\
 	) > $@
@@ -74,11 +71,9 @@
 	$(inform)
 	$e$(fwdecl) $^ > $@
 
-# Force an import of the DOMAIN we're compiling for
 %.imps: %.forwards %.domains
 	$(inform)
 	$e(\
-	$(echo) $(inc)/$(DOMAIN);\
 	$(call dom2imp,$*.domains);\
 	if test -s $*.forwards -a -n "$(types)"; then\
 		$(typeq) -vFILE=$*.forwards $(types) $(redir);\
@@ -136,7 +131,7 @@
 %.c: %.h
 	$(inform)
 	$e(\
-	$(echo) '#include $(DOMAIN)';\
+	$(echo) '#include LIME';\
 	$(echo) '#include <ctype.h>';\
 	$(echo) '#include "$(filter %.h,$^)"';\
 	) > $@