aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 12 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 205b8c2..986ecdc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,21 @@
-PREFIX=
+PREFIX=/usr/local
CFLAGS=-Wall -Wextra -pedantic -Wmissing-prototypes -Wstrict-prototypes
+LDFLAGS=
G ?=
O ?= -O3
+CFILES=compiler.c grammar.c utils.c vm.c
+OBJFILES=$(CFILES:.c=.o)
+
all: bpeg
-clean:
- rm -f bpeg
+.c.o:
+ cc -c $(CFLAGS) $(G) $(O) -o $@ $<
-bpeg: bpeg.c bpeg.h utils.h
- cc $(CFLAGS) $(G) $(O) $< -o $@
+bpeg: $(OBJFILES) bpeg.c
+ cc $(CFLAGS) $(G) $(O) -o $@ $^
+
+clean:
+ rm -f bpeg $(OBJFILES)
.PHONY: all clean