Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git rebase #1

Open
zvezdochiot opened this issue Jun 15, 2022 · 0 comments
Open

git rebase #1

zvezdochiot opened this issue Jun 15, 2022 · 0 comments
Assignees
Labels
complete Performed documentation Improvements or additions to documentation

Comments

@zvezdochiot
Copy link
Member

zvezdochiot commented Jun 15, 2022

Type:

$ git filter-branch --force --index-filter "git rm --cached --ignore-unmatch bin/* demo/* linux/* samples/* view.gif" --prune-empty --tag-name-filter cat -- --all
$ git -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 -c gc.rerereunresolved=0 -c gc.pruneExpire=now gc "$@"
## upgrade git (see git show)
$ git add -A
$ git commit -m "0.1.0: pkg-config and clean"
$ git show
commit 774512f13dfdd3fc5843c59184e9bc73e5eff7fe (HEAD -> opengl, origin/opengl, origin/HEAD)
Author: zvezdochiot <[email protected]>
Date:   Fri Jul 15 03:52:01 2022 +0300

    0.1.0: pkg-config and clean

diff --git a/Makefile b/Makefile
index e2d2044..ef2955a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,32 +1,42 @@
+# platform detection using OS environment variable for Windows
+# and uname output of everthing else
+ifeq ($(OS),Windows_NT)
+    PLATFORM := Windows
+else
+    PLATFORM := $(shell uname)
+endif
+
 SRC_PATH=./src/
 CC=gcc
-COMPILER_FLAGS = -g -c -MD
-#LINKER_FLAGS = -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lm -lGLU32 -lGLEW32 -llua
-LINKER_FLAGS = -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lm -lGLU32 -lGLEW32 -llua
-INCLUDE_PATHS = -I. -I./src/ -I/mingw64/include -I/mingw64/include/SDL2
-LIBRARY_PATHS = -L/mingw64/lib -L.
-EXE=cadzinho.exe
+CFLAGS = -g -c -DPLATFORM_$(PLATFORM) -I. -I./src/
+LDFLAGS = -lm -lGLEW -L/usr/lib -L.
+TARGET=cadzinho
+
+ifeq ($(PLATFORM),Darwin)
+    CFLAGS += -I/usr/local/Cellar/lua/5.4.3/include/lua/
+    LDFLAGS += -framework OpenGL
+else
+    LDFLAGS += -lGL -lGLU
+endif
+
+ifeq ($(PLATFORM),Linux)
+    CFLAGS += `pkg-config --cflags lua sdl2`
+    LDFLAGS += -ldl -lpthread -pthread `pkg-config --libs lua sdl2`
+else
+    CFLAGS += -I/usr/include/SDL2
+    LDFLAGS += `sdl2-config --cflags --libs` -llua
+endif
 
 SRC=$(wildcard $(SRC_PATH)*.c)
 OBJ=$(subst ./src, ./obj, $(SRC:.c=.o))
-DEP=$(OBJ:.o=.d)
-
-all: $(SRC) $(EXE)
 
-cz.res: cz.rc
-       windres cz.rc -O coff -o cz.res
+all: $(SRC) $(TARGET)
 
-$(EXE): $(OBJ) cz.res
-       $(CC) $(LIBRARY_PATHS) $(LINKER_FLAGS) $(OBJ) $(LINKER_FLAGS) cz.res -o $@
+$(TARGET): $(OBJ)
+       $(CC) $^ $(LDFLAGS) -o $@
 
 ./obj/%.o: ./src/%.c
-       $(CC) $(INCLUDE_PATHS) $(COMPILER_FLAGS) -o $@ $<
-
-clean:
-       rm -rf run $(OBJ)
-       rm -rf run $(DEP)
-
--include $(DEP)
+       $(CC) $(CFLAGS) -o $@ $<
 
 clean:
-       rm -rf run $(OBJ)
+       rm -rf run $(OBJ) $(TARGET)
diff --git a/Makefile.mingw b/Makefile.mingw
new file mode 100644
index 0000000..e2d2044
--- /dev/null
+++ b/Makefile.mingw
@@ -0,0 +1,32 @@
+SRC_PATH=./src/
+CC=gcc
+COMPILER_FLAGS = -g -c -MD
+#LINKER_FLAGS = -Wl,-subsystem,windows -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lm -lGLU32 -lGLEW32 -llua
+LINKER_FLAGS = -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lm -lGLU32 -lGLEW32 -llua
+INCLUDE_PATHS = -I. -I./src/ -I/mingw64/include -I/mingw64/include/SDL2
+LIBRARY_PATHS = -L/mingw64/lib -L.
+EXE=cadzinho.exe
+
+SRC=$(wildcard $(SRC_PATH)*.c)
+OBJ=$(subst ./src, ./obj, $(SRC:.c=.o))
+DEP=$(OBJ:.o=.d)
+
+all: $(SRC) $(EXE)
+
+cz.res: cz.rc
+       windres cz.rc -O coff -o cz.res
+
+$(EXE): $(OBJ) cz.res
+       $(CC) $(LIBRARY_PATHS) $(LINKER_FLAGS) $(OBJ) $(LINKER_FLAGS) cz.res -o $@
+
+./obj/%.o: ./src/%.c
+       $(CC) $(INCLUDE_PATHS) $(COMPILER_FLAGS) -o $@ $<
+
+clean:
+       rm -rf run $(OBJ)
+       rm -rf run $(DEP)
+
+-include $(DEP)
+
+clean:
+       rm -rf run $(OBJ)
diff --git a/README.md b/README.md
index 80e6a1b..5ffa31f 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,27 @@
 # CadZinho
 
+`Origin_`:
 ![stars](https://img.shields.io/github/stars/zecruel/CadZinho)
 ![forks](https://img.shields.io/github/forks/zecruel/CadZinho)
 ![size](https://img.shields.io/github/repo-size/zecruel/CadZinho)
 ![issues](https://img.shields.io/github/issues/zecruel/CadZinho)
-![licence](https://img.shields.io/github/license/zecruel/CadZinho)
+![licence](https://img.shields.io/github/license/zecruel/CadZinho)  
+`ORG.GLC`:
+![GitHub release (latest by date)](https://img.shields.io/github/v/release/Geo-Linux-Calculations/cadzinho)
+![GitHub Release Date](https://img.shields.io/github/release-date/Geo-Linux-Calculations/cadzinho)
+![GitHub repo size](https://img.shields.io/github/repo-size/Geo-Linux-Calculations/cadzinho)
+![GitHub all releases](https://img.shields.io/github/downloads/Geo-Linux-Calculations/cadzinho/total)
+![GitHub](https://img.shields.io/github/license/Geo-Linux-Calculations/cadzinho)
 
-![logo](/logo.png)
+![logo](./logo.png)
 
 Minimalist computer aided design (CAD) software
 (SDL 2.0 and OpenGL 3.2 port)
 
 Try it: https://github.com/zecruel/CadZinho/releases/
 
-![Screen shot](/screenshot.png)
+![Screen shot](./screenshot.png)
 
-![view](/view.gif)
-
-Demo:
-
-
-https://user-images.githubusercontent.com/17029180/164306370-d19051df-65f4-42a6-9c86-94a550b7e13a.mp4
+See demo and samples: https://github.com/Geo-Linux-Calculations/cadzinho-demo
 
+Origin repo: https://github.com/zecruel/CadZinho
$ git gc --prune=now --aggressive
$ git push origin --force --all
$ git push origin --force --tags

Old size:

New size:

@zvezdochiot zvezdochiot added complete Performed documentation Improvements or additions to documentation labels Jun 15, 2022
@zvezdochiot zvezdochiot self-assigned this Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complete Performed documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant