diff lwbasic/rules.make @ 22:7c35fa8dbc91

Added initial framework for lwbasic
author lost@l-w.ca
date Sat, 22 Jan 2011 21:01:03 -0700
parents
children 25a4aef9c5ed
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lwbasic/rules.make	Sat Jan 22 21:01:03 2011 -0700
@@ -0,0 +1,28 @@
+dirname := $(dir $(lastword $(MAKEFILE_LIST)))
+lwbasic_dir := $(dirname)
+
+lwbasic_lsrcs := main.c
+
+lwbasic_srcs := $(addprefix $(dirname),$(lwbasic_lsrcs))
+lwbasic_objs := $(lwbasic_srcs:.c=.o)
+lwbasic_deps := $(lwbasic_srcs:.c=.d)
+
+
+
+$(lwbasic_dir)lwbasic$(PROGSUFFIX): $(lwbasic_objs) lwlib $(lwbasic_dir)rules.make
+	@echo "Linking $@"
+	@$(CC) -o $@ $(lwbasic_objs) $(LDFLAGS)
+
+cleantargs := $(cleantargs) lwbasicclean
+realcleantargs := $(realcleantargs) lwbasicrealclean
+
+.PHONY: lwbasicclean lwbasicrealclean
+lwbasicrealclean:
+	@echo "Really cleaning up lwbasic"
+	@cd $(lwbasic_dir) && rm -f *.d
+
+lwbasicclean:
+	@echo "Cleaning up lwbasic"
+	@cd $(lwbasic_dir) && rm -f *.o *.exe lwbasic
+
+-include $(lwbasic_deps)