File tree 1 file changed +24
-3
lines changed
1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,30 @@ SRCS = $(wildcard $(SRC_DIR)/*.c) \
14
14
# Object files
15
15
OBJS = $(SRCS:%.c=$(BUILD_DIR ) /%.o )
16
16
17
- # Target executable
18
- TARGET = $(BIN_DIR ) /gitkeykit
17
+ # variables for architecture and OS detection
18
+ ifeq ($(OS ) ,Windows_NT)
19
+ DETECTED_OS := windows
20
+ ifeq ($(PROCESSOR_ARCHITECTURE),AMD64)
21
+ DETECTED_ARCH := x86_64
22
+ else ifeq ($(PROCESSOR_ARCHITECTURE),x86)
23
+ DETECTED_ARCH := x86
24
+ else
25
+ DETECTED_ARCH := $(PROCESSOR_ARCHITECTURE )
26
+ endif
27
+ else
28
+ DETECTED_OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
29
+ DETECTED_ARCH := $(shell uname -m)
30
+ # Normalize architecture names
31
+ ifeq ($(DETECTED_ARCH),x86_64)
32
+ DETECTED_ARCH := amd64
33
+ endif
34
+ ifeq ($(DETECTED_ARCH),aarch64)
35
+ DETECTED_ARCH := arm64
36
+ endif
37
+ endif
38
+
39
+ # Modify the target executable name to include OS and architecture
40
+ TARGET = $(BIN_DIR ) /gitkeykit-$(DETECTED_OS ) -$(DETECTED_ARCH )
19
41
20
42
# Platform-specific settings
21
43
ifeq ($(OS ) ,Windows_NT)
@@ -41,7 +63,6 @@ directories:
41
63
$(MKDIR ) $(BUILD_DIR ) /$(SRC_DIR ) /utils
42
64
endif
43
65
44
- # Add this near the top, after the variables but before the platform-specific settings
45
66
all : directories $(TARGET )
46
67
47
68
# Link the final executable
You can’t perform that action at this time.
0 commit comments