This repository was archived by the owner on Apr 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-25
lines changed Expand file tree Collapse file tree 1 file changed +5
-25
lines changed Original file line number Diff line number Diff line change 1
1
# Compiler
2
2
CC = gcc
3
- CXX = g++
4
3
5
4
# Compiler flags
6
5
CFLAGS = -std=c11 -Wall -Wextra
7
- CXXFLAGS = -std=c++20 -Wall -Wextra
8
6
9
7
# Include directories
10
8
INCLUDES = -Iinclude
11
9
12
10
# Libraries
13
11
CLIBS =
14
- CXXLIBS =
15
12
16
13
# Source files
17
14
CSRCS = $(wildcard src/* .c)
18
- CXXSRCS = $(wildcard src/* .cpp)
19
15
20
16
# Object files
21
17
COBJS = $(CSRCS:.c=.o )
22
18
COBJS := $(addprefix build/, $(COBJS ) )
23
19
24
- CXXOBJS = $(CXXSRCS:.cpp=.o )
25
- CXXOBJS := $(addprefix build/, $(CXXOBJS ) )
26
-
27
20
# Executable name
28
21
MAIN = main
29
22
@@ -35,32 +28,20 @@ all: $(MAIN)
35
28
@echo " Bitlab has been compiled"
36
29
37
30
debug : CFLAGS += -g -DDEBUG -D_DEBUG
38
- debug : CXXFLAGS += -g -DDEBUG -D_DEBUG
39
31
debug : $(MAIN )
40
32
@echo " Bitlab has been compiled in debug mode"
41
33
42
34
# ## Choose one of the following for C or C++ compilation -------------------
43
35
44
- # $(MAIN): $(COBJS)
45
- # @mkdir -p build/bin
46
- # $(CC) $(CFLAGS) $(INCLUDES) -o build/bin/$(MAIN) $(COBJS) $(CLIBS)
47
-
48
- $(MAIN ) : $(CXXOBJS )
36
+ $(MAIN ) : $(COBJS )
49
37
@mkdir -p build/bin
50
- $(CXX ) $(CXXFLAGS ) $(INCLUDES ) -o build/bin/$(MAIN ) $(CXXOBJS ) $(CXXLIBS )
38
+ $(CC ) $(CFLAGS ) $(INCLUDES ) -o build/bin/$(MAIN ) $(COBJS ) $(CLIBS )
51
39
52
- # build/%.o: %.c
53
- # @mkdir -p $(@D)
54
- # $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
55
-
56
- build/% .o : % .cpp
40
+ build/% .o : % .c
57
41
@mkdir -p $(@D )
58
- $(CXX ) $(CXXFLAGS ) $(INCLUDES ) -c $< -o $@
59
-
60
- # depend: $(CSRCS)
61
- # makedepend $(INCLUDES) $^
42
+ $(CC ) $(CFLAGS ) $(INCLUDES ) -c $< -o $@
62
43
63
- depend : $(CXXSRCS )
44
+ depend : $(CSRCS )
64
45
makedepend $(INCLUDES ) $^
65
46
66
47
# ## -----------------------------------------------------------------------
72
53
73
54
# Include dependency files
74
55
-include $(SRCS :.c=.d)
75
- -include $(SRCS :.cpp=.d)
You can’t perform that action at this time.
0 commit comments