Merge branch pull request #5 into main
diff --git a/Makefile b/Makefile
index f72e180..6006565 100644
--- a/Makefile
+++ b/Makefile
@@ -23,9 +23,11 @@
 ifeq ($(CARAVEL_LITE),1) 
 	CARAVEL_NAME := caravel-lite
 	CARAVEL_REPO := https://github.com/efabless/caravel-lite 
+	CARAVEL_COMMIT := main
 else
 	CARAVEL_NAME := caravel
 	CARAVEL_REPO := https://github.com/efabless/caravel 
+	CARAVEL_COMMIT := master
 endif
 
 # Install caravel as submodule, (1): submodule, (0): clone
@@ -74,10 +76,12 @@
 	@echo "Installing $(CARAVEL_NAME) as a submodule.."
 	@if [ ! -d $(CARAVEL_ROOT) ]; then git submodule add --name $(CARAVEL_NAME) $(CARAVEL_REPO) $(CARAVEL_ROOT); fi
 	@git submodule update --init
+	@cd $(CARAVEL_ROOT); git checkout $(CARAVEL_HASH)
 	$(MAKE) simlink
 else
 	@echo "Installing $(CARAVEL_NAME).."
 	@git clone $(CARAVEL_REPO) $(CARAVEL_ROOT)
+	@cd $(CARAVEL_ROOT); git checkout $(CARAVEL_HASH)
 endif
 
 # Create symbolic links to caravel's main files
@@ -97,7 +101,7 @@
 	@git submodule update --init
 else
 	cd $(CARAVEL_ROOT)/ && \
-		git checkout master && \
+		git checkout $(CARAVEL_COMMIT) && \
 		git pull
 endif
 
@@ -106,6 +110,7 @@
 uninstall: 
 ifeq ($(SUBMODULE),1)
 	git submodule deinit -f $(CARAVEL_ROOT)
+	sed -ie '/\[submodule \"caravel\"\]/,/\url =/d' .gitmodules
 	rm -rf .git/modules/$(CARAVEL_NAME)
 	git rm -f $(CARAVEL_ROOT)
 else