diff Makefile @ 295:4b17780f2777 ccdev

Checkpoint lwcc development Changed tactics with the preprocessor. Instead of getting clever and trying to do things the "fast" way, instead, just tokenize the whole input and process it that way. Also, set up so the preprocessor and compiler can be integrated instead of having to have a specifically correct output for the preprocessed file. Also removed the subdirectories in the lwcc directory. It made things more complicated than they needed to be.
author William Astle <lost@l-w.ca>
date Thu, 12 Sep 2013 22:06:26 -0600
parents 048adfee2933
children 83fcc1ed6ad6
line wrap: on
line diff
--- a/Makefile	Tue Sep 10 19:56:05 2013 -0600
+++ b/Makefile	Thu Sep 12 22:06:26 2013 -0600
@@ -55,10 +55,10 @@
 	lwlink/lwlink$(PROGSUFFIX) \
 	lwar/lwar$(PROGSUFFIX) \
 	lwlink/lwobjdump$(PROGSUFFIX) \
-	lwcc/driver/lwcc$(PROGSUFFIX) \
-	lwcc/cpp/lwcc-cpp$(PROGSUFFIX)
+	lwcc/lwcc$(PROGSUFFIX) \
+	lwcc/lwcc-cpp$(PROGSUFFIX)
 
-LWCC_LIBBIN_FILES = lwcc/cpp/lwcc-cpp$(PROGSUFFIX)
+LWCC_LIBBIN_FILES = lwcc/lwcc-cpp$(PROGSUFFIX)
 LWCC_LIBLIB_FILES =
 LWCC_LIBINC_FILES =
 
@@ -96,23 +96,25 @@
 lwlib_deps := $(lwlib_srcs:.c=.d)
 lwobjdump_deps := $(lwobjdump_srcs:.c=.d)
 
-lwcc_driver_srcs := main.c
-lwcc_driver_srcs := $(addprefix lwcc/driver/,$(lwcc_driver_srcs))
+lwcc_driver_srcs := driver-main.c
+lwcc_driver_srcs := $(addprefix lwcc/,$(lwcc_driver_srcs))
 lwcc_driver_objs := $(lwcc_driver_srcs:.c=.o)
 lwcc_driver_deps := $(lwcc_driver_srcs:.c=.d)
 
-lwcc_cpp_srcs := main.c error.c file.c preproc.c char_p.c symbol.c
-lwcc_cpp_srcs := $(addprefix lwcc/cpp/,$(lwcc_cpp_srcs))
+lwcc_cpp_srcs := cpp-main.c cpp.c lex.c strbuf.c token.c
+lwcc_cpp_srcs := $(addprefix lwcc/,$(lwcc_cpp_srcs))
 lwcc_cpp_objs := $(lwcc_cpp_srcs:.c=.o)
 lwcc_cpp_deps := $(lwcc_cpp_srcs:.c=.d)
 
+lwcc_deps := $(lwcc_cpp_deps) $(lwcc_driver_deps)
+
 .PHONY: lwlink lwasm lwar lwobjdump lwcc
 lwlink: lwlink/lwlink$(PROGSUFFIX)
 lwasm: lwasm/lwasm$(PROGSUFFIX)
 lwar: lwar/lwar$(PROGSUFFIX)
 lwobjdump: lwlink/lwobjdump$(PROGSUFFIX)
-lwcc: lwcc/driver/lwcc$(PROGSUFFIX)
-lwcc-cpp: lwcc/cpp/lwcc-cpp$(PROGSUFFIX)
+lwcc: lwcc/lwcc$(PROGSUFFIX)
+lwcc-cpp: lwcc/lwcc-cpp$(PROGSUFFIX)
 
 lwasm/lwasm$(PROGSUFFIX): $(lwasm_objs) lwlib
 	@echo Linking $@
@@ -130,11 +132,11 @@
 	@echo Linking $@
 	@$(CC) -o $@ $(lwar_objs) $(LDFLAGS)
 
-lwcc/driver/lwcc$(PROGSUFFIX): $(lwcc_driver_objs) lwlib
+lwcc/lwcc$(PROGSUFFIX): $(lwcc_driver_objs) lwlib
 	@echo Linking $@
 	@$(CC) -o $@ $(lwcc_driver_objs) $(LDFLAGS)
 
-lwcc/cpp/lwcc-cpp$(PROGSUFFIX): $(lwcc_cpp_objs) lwlib
+lwcc/lwcc-cpp$(PROGSUFFIX): $(lwcc_cpp_objs) lwlib
 	@echo Linking $@
 	@$(CC) -o $@ $(lwcc_cpp_objs) $(LDFLAGS)
 
@@ -168,7 +170,7 @@
 clean: $(cleantargs)
 	@echo "Cleaning up"
 	@rm -f lwlib/liblw.a lwasm/lwasm$(PROGSUFFIX) lwlink/lwlink$(PROGSUFFIX) lwlink/lwobjdump$(PROGSUFFIX) lwar/lwar$(PROGSUFFIX)
-	@rm -f lwcc/driver/lwcc$(PROGSUFFIX) lwcc/cpp/lwcc-cpp$(PROGSUFFIX)
+	@rm -f lwcc/lwcc$(PROGSUFFIX) lwcc/lwcc-cpp$(PROGSUFFIX)
 	@rm -f $(lwcc_driver_ojbs) $(lwcc_cpp_objs)
 	@rm -f $(lwasm_objs) $(lwlink_objs) $(lwar_objs) $(lwlib_objs) $(lwobjdump_objs)
 	@rm -f $(extra_clean)