aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorc+12023-05-30 08:16:31 -0400
committerc+12023-05-30 08:16:31 -0400
commit8b008c1c2773ac80df36f7a49dcb9c2c451cd258 (patch)
tree502c30edb699564f620d57c17e41e34e4a88ae3d
parent81406518603f07f65d51c694e56143edc05d7df5 (diff)
fixed makefile
-rw-r--r--Makefile28
1 files changed, 17 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index b6866bc..42b6fdb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,26 @@
-exec = halk.out
-sources := $(wildcard src/*.c)
-objects = $(sources:.c=.o)
-sources := $(filter-out src/parser.c, $(sources)) # exclude the incomplete parser for now.
-flags = -g
+binname := halk
+exec := $(binname).out
+
+compiler := clang
+flags := -g
+
+sources := $(wildcard src/*.c)
+sources := $(filter-out src/parser.c, $(sources)) # exclude the incomplete parser for now.
+objects := $(sources:.c=.o)
+
$(exec): $(objects)
- clang $(objects) $(flags) -o $(exec)
+ $(compiler) $(objects) $(flags) -o $(exec)
%.o: %.c include/%.h
- clang -c $(flags) $< -o $@
+ $(compiler) -c $(flags) $< -o $@
install:
make
- cp ./halk.out /usr/local/bin/halk
+ cp ./$(exec) /usr/local/bin/$(binname)
+
+uninstall:
+ rm -f /usr/local/bin/$(binname)
clean:
- -rm *.out
- -rm *.o
- -rm src/*.o
+ rm -f *.out *.o src/*.o