blob: 0597b0b892714148a2502b3052000891754706b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
diff '--color=auto' -u -r -N my_basic-git/makefile my_basic-git-makefile/makefile
--- my_basic-git/makefile 2022-08-25 17:22:17.043773022 +0200
+++ my_basic-git-makefile/makefile 2022-08-25 17:25:35.292744445 +0200
@@ -1,3 +1,5 @@
+CFLAGS=-Os
+
OS := $(shell uname -s)
IS_APPLE := $(shell echo $(OS)|grep -i darwin)
@@ -9,20 +11,20 @@
my_basic_arm_app.o: my_basic_arm.o main_arm.o
cc -o my_basic_arm_app.o my_basic_arm.o main_arm.o -target arm64-apple-macos11
my_basic_x86.o: core/my_basic.c core/my_basic.h
- cc -Os -c core/my_basic.c -Wno-multichar -Wno-overflow -Wno-unused-result -o my_basic_x86.o -target x86_64-apple-macos10.12
+ cc $(CFLAGS) -c core/my_basic.c -Wno-multichar -Wno-overflow -Wno-unused-result -o my_basic_x86.o -target x86_64-apple-macos10.12
main_x86.o: shell/main.c core/my_basic.h
- cc -Os -c shell/main.c -Wno-unused-result -o main_x86.o -target x86_64-apple-macos10.12
+ cc $(CFLAGS) -c shell/main.c -Wno-unused-result -o main_x86.o -target x86_64-apple-macos10.12
my_basic_arm.o: core/my_basic.c core/my_basic.h
- cc -Os -c core/my_basic.c -Wno-multichar -Wno-overflow -Wno-unused-result -o my_basic_arm.o -target arm64-apple-macos11
+ cc $(CFLAGS) -c core/my_basic.c -Wno-multichar -Wno-overflow -Wno-unused-result -o my_basic_arm.o -target arm64-apple-macos11
main_arm.o: shell/main.c core/my_basic.h
- cc -Os -c shell/main.c -Wno-unused-result -o main_arm.o -target arm64-apple-macos11
+ cc $(CFLAGS) -c shell/main.c -Wno-unused-result -o main_arm.o -target arm64-apple-macos11
else
my_basic: my_basic.o main.o
cc -o output/my_basic my_basic.o main.o -lm -lrt
my_basic.o: core/my_basic.c core/my_basic.h
- cc -Os -c core/my_basic.c -Wno-multichar -Wno-overflow -Wno-unused-result
+ cc $(CFLAGS) -c core/my_basic.c -Wno-multichar -Wno-overflow -Wno-unused-result
main.o: shell/main.c core/my_basic.h
- cc -Os -c shell/main.c -Wno-unused-result
+ cc $(CFLAGS) -c shell/main.c -Wno-unused-result
endif
clean:
|