Usermode - Working on new build/makefile system
[tpg/acess2.git] / Usermode / Libraries / acess.ld_src / rules.mk
diff --git a/Usermode/Libraries/acess.ld_src/rules.mk b/Usermode/Libraries/acess.ld_src/rules.mk
new file mode 100644 (file)
index 0000000..f2f3de0
--- /dev/null
@@ -0,0 +1,20 @@
+include $(BASE)header.mk
+
+# Variables
+BIN = $(OUTPUTDIR)Libs/acess.ld
+
+# Rules
+.PHONY: all-$(DIR)
+
+all-$(DIR): $(BIN)
+clean-$(DIR):
+       $(RM) $(BIN)
+
+$(BIN):        $(DIR)/acess_$(ARCHDIR).ld.h
+       @mkdir -p $(dir $(BIN))
+       cpp -nostdinc -U i386 -P -C $< -o $@ -D__LIBDIR=$(OUTPUTDIR)Libs
+
+$(DIR)/acess_$(ARCHDIR).ld.h:
+       $(LD) --verbose | awk '{ if( substr($$0,0,5) == "====="){ bPrint = !bPrint; } else { if(bPrint){ print $$0;} } }' | sed 's/SEARCH_DIR\(.*\)/SEARCH_DIR(__LIBDIR)/' > $@
+
+include $(BASE)footer.mk

UCC git Repository :: git.ucc.asn.au