summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2015-10-19 02:26:00 +0800
committerTing-Wei Lan <lantw44@gmail.com>2015-10-19 02:38:51 +0800
commite9165b8926ba90e43392d80bf84a32658f9f5a44 (patch)
treef10bfa892b5f3fcbb8d49d34a7ff68d338fd6c16
parente375aeb9706f13278be1ef828994529ba652ac2d (diff)
downloadcompiler2015-e9165b8926ba90e43392d80bf84a32658f9f5a44.tar
compiler2015-e9165b8926ba90e43392d80bf84a32658f9f5a44.tar.gz
compiler2015-e9165b8926ba90e43392d80bf84a32658f9f5a44.tar.bz2
compiler2015-e9165b8926ba90e43392d80bf84a32658f9f5a44.tar.lz
compiler2015-e9165b8926ba90e43392d80bf84a32658f9f5a44.tar.xz
compiler2015-e9165b8926ba90e43392d80bf84a32658f9f5a44.tar.zst
compiler2015-e9165b8926ba90e43392d80bf84a32658f9f5a44.zip
Rewrite Makefile to use default rules specified by POSIX
-rw-r--r--Makefile21
-rw-r--r--Makefile.simple10
2 files changed, 10 insertions, 21 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index e99acd1..0000000
--- a/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-TARGET = scanner
-OBJECT = lex.yy.o symboltable.o
-CC = cc -g
-LEX = flex
-LIBS = -lfl
-
-scanner: lex.yy.o symboltable.o
- $(CC) -o scanner lex.yy.o symboltable.o
-
-symboltable.o: symboltable.c
- $(CC) -c symboltable.c
-
-lex.yy.o: lex.yy.c
- $(CC) -c lex.yy.c
-
-lex.yy.c: lexer.l
- $(LEX) $(LIB) lexer.l
-
-clean:
- rm -f $(TARGET) $(OBJECT)
-
diff --git a/Makefile.simple b/Makefile.simple
new file mode 100644
index 0000000..e5051ed
--- /dev/null
+++ b/Makefile.simple
@@ -0,0 +1,10 @@
+targets = scanner
+scanner_objects = lexer.o symboltable.o
+
+.PHONY: all clean
+
+all: $(targets)
+scanner: $(scanner_objects)
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(scanner_objects) $(LDLIBS) -o scanner
+clean:
+ rm -f $(targets) $(scanner_objects)