Browse Source

making this program installable

Noah 4 năm trước cách đây
mục cha
commit
518609291c
1 tập tin đã thay đổi với 24 bổ sung4 xóa
  1. 24 4
      Makefile

+ 24 - 4
Makefile

@@ -1,4 +1,11 @@
-PROJDIRS := src
+# tibasicc - a compiler for TI-BASIC code 
+# See LICENSE file for copyright and license details.  PROJDIRS := src
+
+VERSION = 0.1
+
+# paths
+PREFIX = /usr/local/
+
 SRCFILES := $(shell find $(PROJDIRS) -type f -name "*.cpp")
 OBJFILES := $(patsubst %.cpp,%.o,$(SRCFILES))
 DEPFILES := $(patsubst %.cpp,%.d,$(SRCFILES))
@@ -9,12 +16,25 @@ CXXFLAGS := -g -Wall -pedantic -Werror
 
 CXX := g++
 
-all: tibasic
+all: tibasicc
 
-tibasic: $(OBJFILES)
-	g++ -o tibasic $(OBJFILES)
+tibasicc: $(OBJFILES)
+	g++ -o tibasicc $(OBJFILES)
 
 -include $(DEPFILES)
 
 %.o: %.c
 	@$(CXX) $(CFLAGS) -MMD -MP -c $< -o $@
+
+clean:
+		rm -f $(OBJFILES)/*.o
+
+install: all
+	mkdir -p ${PREFIX}/bin
+	cp -f tibasicc ${PREFIX}/bin
+	chmod 755 ${PREFIX}/bin/tibasicc
+
+uninstall:
+	rm -f ${PREFIX}/bin/tibasicc
+
+.PHONY: all clean install uninstall