Compare commits
3 Commits
434d64f6af
...
7984d71a7c
Author | SHA1 | Date |
---|---|---|
Edi De Candido | 7984d71a7c | |
Edi De Candido | f66c7ff5b8 | |
Edi De Candido | a78c4b1a33 |
|
@ -33,4 +33,5 @@
|
|||
*.app
|
||||
|
||||
# Main
|
||||
src/main.cpp
|
||||
src/main.cpp
|
||||
*.txt
|
37
Makefile
37
Makefile
|
@ -28,28 +28,35 @@ FILES := $(notdir $(basename $(SRCS)))
|
|||
OBJS := $(addprefix $(OBJ_DIR)/,$(addsuffix .o,$(FILES)))
|
||||
|
||||
|
||||
#---------------------------------------------------
|
||||
all:
|
||||
<<<<<<< HEAD
|
||||
|
||||
all:
|
||||
|
||||
|
||||
=======
|
||||
#---------------------------------------------------
|
||||
>>>>>>> b5b04b6 (implement my first regexp)
|
||||
execute: linking
|
||||
@ echo execute...
|
||||
@ ./$(TARGET)
|
||||
@ echo ...terminate
|
||||
|
||||
#---------------------------------------------------
|
||||
linking: $(OBJS)
|
||||
@ echo linking
|
||||
@ $(CXX) $(WFLAGS) $(OFLAG) $(TARGET) $(OBJS)
|
||||
|
||||
#---------------------------------------------------
|
||||
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(OBJ_DIR)
|
||||
@ echo compile $<
|
||||
@ $(CXX) $(WFLAGS) -c $< $(OFLAG) $@ $(INCLUDE)
|
||||
|
||||
#---------------------------------------------------
|
||||
$(OBJ_DIR):
|
||||
mkdir -p $(OBJ_DIR)
|
||||
|
||||
#---------------------------------------------------
|
||||
clean:
|
||||
@ rm -rf $(OBJ)
|
||||
|
||||
#---------------------------------------------------
|
||||
|
||||
|
||||
# random git command
|
||||
|
@ -65,7 +72,7 @@ git_push:
|
|||
_commit: git_commit git_push
|
||||
|
||||
git_commit:
|
||||
read -p "Enter git message: " msg; \
|
||||
@ read -p "Enter git message: " msg; \
|
||||
git commit -am "$$msg"
|
||||
|
||||
# remove a file only on git, not local
|
||||
|
@ -73,7 +80,23 @@ _remove: git_rm git_push
|
|||
|
||||
git_rm:
|
||||
git rm --cached $(FILE)
|
||||
|
||||
|
||||
git_reset: _dump _reset
|
||||
|
||||
_reset:
|
||||
git reset --hard HEAD^
|
||||
|
||||
# awk work with regexp
|
||||
# the expression is $1 ~ /commit/ { print $2 }:
|
||||
# $N -> nth word
|
||||
# ~ -> when the operand coincide is true
|
||||
# /word/: -> the word appears
|
||||
# translate: write only the second word
|
||||
# where appears "commit" in first field
|
||||
|
||||
_dump:
|
||||
@ git log | awk '$$1 ~ /commit/ { print $$2 }' > dump_git_tree.txt
|
||||
|
||||
|
||||
# difference between local and git
|
||||
git_diff:
|
||||
|
|
Loading…
Reference in New Issue