Browse Source

Started establishing the build system

Cameron Weinfurt 1 year ago
parent
commit
6d5f24f135
3 changed files with 28 additions and 0 deletions
  1. 1
    0
      .gitignore
  2. 21
    0
      Makefile
  3. 6
    0
      main.c

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
1
+*.o

+ 21
- 0
Makefile View File

@@ -0,0 +1,21 @@
1
+objs = main.o
2
+
3
+CC = clang
4
+OUT_NAME = the_alloc
5
+
6
+dev: FLAGS= -g -D UNIT_TESTS
7
+dev: $(OUT_NAME)
8
+	valgrind ./$(OUT_NAME)
9
+
10
+release: FLAGS= -O2
11
+release: clean $(OUT_NAME)
12
+	rm *.o
13
+
14
+$(OUT_NAME): $(objs)
15
+	$(CC) $(FLAGS) -o $(OUT_NAME) $(objs)
16
+
17
+clean:
18
+	rm -f *.o $(OUT_NAME)
19
+
20
+main.o: main.c
21
+	$(CC) $(FLAGS) -c main.c -o main.o

+ 6
- 0
main.c View File

@@ -0,0 +1,6 @@
1
+#include <stdio.h>
2
+
3
+int main() {
4
+	printf("Hello, World!\n");
5
+	return 0;
6
+}

Loading…
Cancel
Save