demake 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/demake +4 -2
- data/lib/apps/example/Makefile +25 -25
- data/lib/apps/example/demake/settings.rb +4 -1
- data/lib/apps/example/src/goodbye.c +0 -0
- data/lib/apps/example/src/hello.c +0 -0
- data/lib/apps/example/src/string/string.c +0 -0
- data/lib/apps/example/src/string/string.h +0 -0
- data/lib/apps/oreo/Makefile +3 -3
- data/lib/apps/oreo/demake/settings.rb +7 -4
- data/lib/apps/oreo/src/defines.h +0 -0
- data/lib/apps/oreo/src/fast_read_file.h +0 -0
- data/lib/apps/oreo/src/oreo.c +0 -0
- data/lib/apps/oreo/src/typedefs.h +0 -0
- data/lib/data/libsrc/auto_bits.h +0 -0
- data/lib/data/libsrc/base.h +0 -0
- data/lib/data/libsrc/cpu_mark_check.h +0 -0
- data/lib/data/libsrc/defines.h +0 -0
- data/lib/data/libsrc/fast_read_file.h +0 -0
- data/lib/data/libsrc/fast_sha2.h +0 -0
- data/lib/data/libsrc/parse_arguments.h +0 -0
- data/lib/data/libsrc/rb_library.c +0 -0
- data/lib/data/libsrc/simple_linked_list +0 -0
- data/lib/data/libsrc/simple_linked_list.c +36 -0
- data/lib/data/libsrc/simple_linked_list.h +91 -0
- data/lib/data/libsrc/smart_alloc.h +45 -0
- data/lib/data/libsrc/typedefs.h +0 -0
- data/lib/template/clean_target.rb +25 -1
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3274ff2579bbe99e1f34dc59d4ea928cc8038f2887299035ce4dd91b48ec1e5f
|
|
4
|
+
data.tar.gz: d3b8bd0a0c724ae6ecf7934fc51ac2d0dabeef510688c864643e6fad63c8dbac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19fbd37bdbae3376ff3a3a2b08d1957d849b10d28d166db72b95e08caac6bae7ad77d6bfbcf038344684fa73a781c2eac26d3d49f44db530f75d49c4fd187e64
|
|
7
|
+
data.tar.gz: a12f2d3c0f18888b523332fc3dbfb612236c11a5bce1112fbede19f7123eac5448095f01c89a4982080849de86256579be314ee0bb09218b3d4a3ca587968b95
|
data/bin/demake
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
require 'rbconfig' # Needed by older versions of Ruby
|
|
7
7
|
require 'pipetext'
|
|
8
8
|
|
|
9
|
-
demake_version = "0.2.
|
|
9
|
+
demake_version = "0.2.2"
|
|
10
10
|
|
|
11
11
|
@silent = false
|
|
12
12
|
@compiler = "gcc"
|
|
@@ -30,8 +30,10 @@ SHORT_WIDTH = BOX_WIDTH - 8
|
|
|
30
30
|
# Contains code, does not get touched
|
|
31
31
|
@source_directory = "src"
|
|
32
32
|
|
|
33
|
-
# These get completely blown away with make clean
|
|
33
|
+
# These can get completely blown away with make clean
|
|
34
|
+
@clean_includes_binary_directory = false
|
|
34
35
|
@binary_directory = "bin"
|
|
36
|
+
@clean_includes_library_directory = false
|
|
35
37
|
@library_directory = "lib"
|
|
36
38
|
@object_directory = "obj"
|
|
37
39
|
|
data/lib/apps/example/Makefile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Makefile automatically generated by Ruby Gem - demake 0.2.
|
|
2
|
+
# Makefile automatically generated by Ruby Gem - demake 0.2.2
|
|
3
3
|
#
|
|
4
4
|
MAKE += -j 8
|
|
5
5
|
CC = gcc
|
|
@@ -146,8 +146,8 @@ menu : LICENSE
|
|
|
146
146
|
@echo "║ [0;33mBuild[0;37m Executable: bin/[0;32mhello[0;37m ║"
|
|
147
147
|
@echo "║ [0;33mBuild[0;37m Executable: bin/[0;32mgoodbye[0;37m ║"
|
|
148
148
|
@echo "╠═════════════════════════════════════════════════════════════════════════╣"
|
|
149
|
-
@echo "║ [1;33mDebug[0;37m Executable: bin/[
|
|
150
|
-
@echo "║ [1;33mDebug[0;37m Executable: bin/[
|
|
149
|
+
@echo "║ [1;33mDebug[0;37m Executable: bin/[1;33mhello_debug[0;37m ║"
|
|
150
|
+
@echo "║ [1;33mDebug[0;37m Executable: bin/[1;33mgoodbye_debug[0;37m ║"
|
|
151
151
|
@echo "╠═════════════════════════════════════════════════════════════════════════╣"
|
|
152
152
|
@echo "║ [0;36mInstall[0;37m [0;33mBinary[0;37m Directory: [0;32m/usr/local/bin/[0;37m ║"
|
|
153
153
|
@echo "║ [0;36mInstall[0;37m [0;35mLibrary[0;37m Directory: [0;32m/usr/local/lib/[0;37m ║"
|
|
@@ -192,7 +192,7 @@ else
|
|
|
192
192
|
endif
|
|
193
193
|
$(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/string/string.c -o $(OBJECT)/string/string.o
|
|
194
194
|
# Dependencies for debug
|
|
195
|
-
|
|
195
|
+
# $(OBJECT)/string/string_debug.o : BUILD_FLAGS := $(DEBUG_FLAGS) $(CFLAGS)
|
|
196
196
|
#
|
|
197
197
|
$(OBJECT)/string/string_debug.o : $(SOURCE)/string/string.c \
|
|
198
198
|
$(SOURCE)/string/string.h
|
|
@@ -205,50 +205,50 @@ endif
|
|
|
205
205
|
$(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/string/string.c -o $(OBJECT)/string/string_debug.o
|
|
206
206
|
|
|
207
207
|
# Dependencies
|
|
208
|
-
$(OBJECT)/
|
|
208
|
+
$(OBJECT)/goodbye.o : $(SOURCE)/goodbye.c \
|
|
209
209
|
$(SOURCE)/string/string.h
|
|
210
|
-
@echo "║ [1;30m🛠[0;37m Compiling... [1;33m$(OBJECT)/
|
|
210
|
+
@echo "║ [1;30m🛠[0;37m Compiling... [1;33m$(OBJECT)/goodbye.o[0;37m"
|
|
211
211
|
ifeq '$(OS)' 'Windows_NT'
|
|
212
212
|
@test -d $(OBJECT)/ || mkdir $(OBJECT)/
|
|
213
213
|
else
|
|
214
214
|
@mkdir -p $(OBJECT)/
|
|
215
215
|
endif
|
|
216
|
-
$(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/
|
|
216
|
+
$(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/goodbye.c -o $(OBJECT)/goodbye.o
|
|
217
217
|
# Dependencies for debug
|
|
218
|
-
|
|
218
|
+
# $(OBJECT)/goodbye_debug.o : BUILD_FLAGS := $(DEBUG_FLAGS) $(CFLAGS)
|
|
219
219
|
#
|
|
220
|
-
$(OBJECT)/
|
|
220
|
+
$(OBJECT)/goodbye_debug.o : $(SOURCE)/goodbye.c \
|
|
221
221
|
$(SOURCE)/string/string.h
|
|
222
|
-
@echo "║ [0;37m🐛 [1;30m🛠[0;37m Compiling... [1;33m$(OBJECT)/
|
|
222
|
+
@echo "║ [0;37m🐛 [1;30m🛠[0;37m Compiling... [1;33m$(OBJECT)/goodbye_debug.o[0;37m"
|
|
223
223
|
ifeq '$(OS)' 'Windows_NT'
|
|
224
224
|
@test -d $(OBJECT)/ || mkdir $(OBJECT)/
|
|
225
225
|
else
|
|
226
226
|
@mkdir -p $(OBJECT)/
|
|
227
227
|
endif
|
|
228
|
-
$(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/
|
|
228
|
+
$(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/goodbye.c -o $(OBJECT)/goodbye_debug.o
|
|
229
229
|
|
|
230
230
|
# Dependencies
|
|
231
|
-
$(OBJECT)/
|
|
231
|
+
$(OBJECT)/hello.o : $(SOURCE)/hello.c \
|
|
232
232
|
$(SOURCE)/string/string.h
|
|
233
|
-
@echo "║ [1;30m🛠[0;37m Compiling... [1;33m$(OBJECT)/
|
|
233
|
+
@echo "║ [1;30m🛠[0;37m Compiling... [1;33m$(OBJECT)/hello.o[0;37m"
|
|
234
234
|
ifeq '$(OS)' 'Windows_NT'
|
|
235
235
|
@test -d $(OBJECT)/ || mkdir $(OBJECT)/
|
|
236
236
|
else
|
|
237
237
|
@mkdir -p $(OBJECT)/
|
|
238
238
|
endif
|
|
239
|
-
$(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/
|
|
239
|
+
$(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/hello.c -o $(OBJECT)/hello.o
|
|
240
240
|
# Dependencies for debug
|
|
241
|
-
|
|
241
|
+
# $(OBJECT)/hello_debug.o : BUILD_FLAGS := $(DEBUG_FLAGS) $(CFLAGS)
|
|
242
242
|
#
|
|
243
|
-
$(OBJECT)/
|
|
243
|
+
$(OBJECT)/hello_debug.o : $(SOURCE)/hello.c \
|
|
244
244
|
$(SOURCE)/string/string.h
|
|
245
|
-
@echo "║ [0;37m🐛 [1;30m🛠[0;37m Compiling... [1;33m$(OBJECT)/
|
|
245
|
+
@echo "║ [0;37m🐛 [1;30m🛠[0;37m Compiling... [1;33m$(OBJECT)/hello_debug.o[0;37m"
|
|
246
246
|
ifeq '$(OS)' 'Windows_NT'
|
|
247
247
|
@test -d $(OBJECT)/ || mkdir $(OBJECT)/
|
|
248
248
|
else
|
|
249
249
|
@mkdir -p $(OBJECT)/
|
|
250
250
|
endif
|
|
251
|
-
$(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/
|
|
251
|
+
$(CC) $(BUILD_FLAGS) $(LIBS) -c $(SOURCE)/hello.c -o $(OBJECT)/hello_debug.o
|
|
252
252
|
|
|
253
253
|
$(BINARY)/hello : BUILD_FLAGS := $(OFLAGS) $(CFLAGS) $(LDFLAGS)
|
|
254
254
|
|
|
@@ -280,7 +280,7 @@ $(BINARY)/hello_debug : BUILD_FLAGS := $(DEBUG_FLAGS) $(CFLAGS) $(LDFLAGS)
|
|
|
280
280
|
|
|
281
281
|
$(BINARY)/hello_debug : LICENSE $(DOL1)
|
|
282
282
|
@echo "╔═════════════════════════════════════════════════════════════════════════╗"
|
|
283
|
-
@echo "║ [0;37m🐛 [1;34m🔗[0;37m Linking Files... bin/[
|
|
283
|
+
@echo "║ [0;37m🐛 [1;34m🔗[0;37m Linking Files... bin/[1;33mhello_debug[0;37m ║"
|
|
284
284
|
@echo "╚═════════════════════════════════════════════════════════════════════════╝"
|
|
285
285
|
ifeq '$(OS)' 'Windows_NT'
|
|
286
286
|
@test -d $(BINARY) || mkdir $(BINARY)
|
|
@@ -293,7 +293,7 @@ $(BINARY)/goodbye_debug : BUILD_FLAGS := $(DEBUG_FLAGS) $(CFLAGS) $(LDFLAGS)
|
|
|
293
293
|
|
|
294
294
|
$(BINARY)/goodbye_debug : LICENSE $(DOL2)
|
|
295
295
|
@echo "╔═════════════════════════════════════════════════════════════════════════╗"
|
|
296
|
-
@echo "║ [0;37m🐛 [1;34m🔗[0;37m Linking Files... bin/[
|
|
296
|
+
@echo "║ [0;37m🐛 [1;34m🔗[0;37m Linking Files... bin/[1;33mgoodbye_debug[0;37m ║"
|
|
297
297
|
@echo "╚═════════════════════════════════════════════════════════════════════════╝"
|
|
298
298
|
ifeq '$(OS)' 'Windows_NT'
|
|
299
299
|
@test -d $(BINARY) || mkdir $(BINARY)
|
|
@@ -314,7 +314,7 @@ else
|
|
|
314
314
|
endif
|
|
315
315
|
$(CC) $(BUILD_FLAGS) $(LIBS) -c $< -o $@
|
|
316
316
|
# General Auto-Dependencies for debug
|
|
317
|
-
|
|
317
|
+
# $(OBJECT)/%_debug.o : BUILD_FLAGS := $(DEBUG_FLAGS) $(CFLAGS)
|
|
318
318
|
#
|
|
319
319
|
$(OBJECT)/%_debug.o : $(SOURCE)/%.c
|
|
320
320
|
@echo "║ [0;37m🐛 [1;30m🛠[0;37m Compiling... [1;33m$(@)[0;37m"
|
|
@@ -329,17 +329,17 @@ endif
|
|
|
329
329
|
|
|
330
330
|
.PHONY : clean
|
|
331
331
|
clean :
|
|
332
|
-
@echo "[0;31m🔥[0;37m Removed [1;33meverything[0;37m from [1;31m$(OBJECT)[0;37m
|
|
333
|
-
@rm -rf $(OBJECT)
|
|
332
|
+
@echo "[0;31m🔥[0;37m Removed [1;33meverything[0;37m from [1;31m$(OBJECT)[0;37m directory"
|
|
333
|
+
@rm -rf $(OBJECT)
|
|
334
334
|
|
|
335
335
|
.PHONY : debug
|
|
336
336
|
debug : LICENSE
|
|
337
337
|
@echo "╔═════════════════════════════════════════════════════════════════════════╗"
|
|
338
|
-
@echo "║ [0;37m🐛 [1;33m🚧[0;37m [0;37mBuilding executable: bin/[
|
|
338
|
+
@echo "║ [0;37m🐛 [1;33m🚧[0;37m [0;37mBuilding executable: bin/[1;33mhello_debug[0;37m ║"
|
|
339
339
|
@echo "╚═════════════════════════════════════════════════════════════════════════╝"
|
|
340
340
|
@$(MAKE) $(BINARY)/hello_debug
|
|
341
341
|
@echo "╔═════════════════════════════════════════════════════════════════════════╗"
|
|
342
|
-
@echo "║ [0;37m🐛 [1;33m🚧[0;37m [0;37mBuilding executable: bin/[
|
|
342
|
+
@echo "║ [0;37m🐛 [1;33m🚧[0;37m [0;37mBuilding executable: bin/[1;33mgoodbye_debug[0;37m ║"
|
|
343
343
|
@echo "╚═════════════════════════════════════════════════════════════════════════╝"
|
|
344
344
|
@$(MAKE) $(BINARY)/goodbye_debug
|
|
345
345
|
|
|
@@ -12,10 +12,13 @@
|
|
|
12
12
|
#
|
|
13
13
|
#@source_directory = "source" # "src"
|
|
14
14
|
#
|
|
15
|
-
# ** make clean
|
|
15
|
+
# ** make clean can delete all files in these directories **
|
|
16
16
|
#
|
|
17
|
+
#@clean_includes_binary_directory = false
|
|
17
18
|
#@binary_directory = "binary" # "bin"
|
|
19
|
+
#@clean_includes_library_directory = false
|
|
18
20
|
#@library_directory = "library" # "lib"
|
|
21
|
+
# By default only object is cleaned
|
|
19
22
|
#@object_directory = "object" # "obj"
|
|
20
23
|
#
|
|
21
24
|
#@emojis = false # true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/apps/oreo/Makefile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#
|
|
2
|
-
# Makefile automatically generated by Ruby Gem - demake 0.2.
|
|
2
|
+
# Makefile automatically generated by Ruby Gem - demake 0.2.2
|
|
3
3
|
#
|
|
4
4
|
MAKE += -j 8
|
|
5
5
|
CC = gcc
|
|
@@ -222,8 +222,8 @@ endif
|
|
|
222
222
|
|
|
223
223
|
.PHONY : clean
|
|
224
224
|
clean :
|
|
225
|
-
@echo "[0;31m🔥[0;37m Removed [1;33meverything[0;37m from [1;31m$(OBJECT)[0;37m
|
|
226
|
-
@rm -rf $(OBJECT)
|
|
225
|
+
@echo "[0;31m🔥[0;37m Removed [1;33meverything[0;37m from [1;31m$(OBJECT)[0;37m directory"
|
|
226
|
+
@rm -rf $(OBJECT)
|
|
227
227
|
|
|
228
228
|
.PHONY : debug
|
|
229
229
|
debug : LICENSE
|
|
@@ -12,11 +12,14 @@
|
|
|
12
12
|
#
|
|
13
13
|
#@source_directory = "source" # "src"
|
|
14
14
|
#
|
|
15
|
-
# ** make clean
|
|
15
|
+
# ** make clean can delete all files in these directories **
|
|
16
16
|
#
|
|
17
|
-
#@
|
|
18
|
-
#@
|
|
19
|
-
#@
|
|
17
|
+
#@clean_includes_binary_directory = false
|
|
18
|
+
#@binary_directory = "binary" # "bin"
|
|
19
|
+
#@clean_includes_library_directory = false
|
|
20
|
+
#@library_directory = "library" # "lib"
|
|
21
|
+
# By default only object is cleaned
|
|
22
|
+
#@object_directory = "object" # "obj"
|
|
20
23
|
#
|
|
21
24
|
#@emojis = false # true
|
|
22
25
|
#@replace_with = "|b*|n" # "|mo|n"
|
data/lib/apps/oreo/src/defines.h
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/apps/oreo/src/oreo.c
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/data/libsrc/auto_bits.h
CHANGED
|
File without changes
|
data/lib/data/libsrc/base.h
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/data/libsrc/defines.h
CHANGED
|
File without changes
|
|
File without changes
|
data/lib/data/libsrc/fast_sha2.h
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#include <stdio.h>
|
|
2
|
+
#include <stdlib.h>
|
|
3
|
+
|
|
4
|
+
#include "base.h"
|
|
5
|
+
#define SIMPLE_DOUBLE_LINKED_LIST
|
|
6
|
+
#define SIMPLE_LINKED_LIST_IMPLEMENTATION
|
|
7
|
+
#include "simple_linked_list.h"
|
|
8
|
+
|
|
9
|
+
i32 main(i32 argc, c8 *argv[])
|
|
10
|
+
{
|
|
11
|
+
struct simple_linked_list_s *head = NULL, *tail = NULL, *s = NULL;
|
|
12
|
+
c8 *a = "a", *b = "b", *c = "c", *d = "d", *e = "e", *f = "f";
|
|
13
|
+
|
|
14
|
+
head = s = calloc(1, sizeof(struct simple_linked_list_s));
|
|
15
|
+
simple_linked_list_init(s, a);
|
|
16
|
+
tail = s = calloc(1, sizeof(struct simple_linked_list_s));
|
|
17
|
+
simple_linked_list_insert_after(head, s, b);
|
|
18
|
+
s = calloc(1, sizeof(struct simple_linked_list_s));
|
|
19
|
+
simple_linked_list_insert_after(tail, s, c);
|
|
20
|
+
tail = s;
|
|
21
|
+
s = calloc(1, sizeof(struct simple_linked_list_s));
|
|
22
|
+
simple_linked_list_insert_after(tail, s, f);
|
|
23
|
+
tail = s;
|
|
24
|
+
s = calloc(1, sizeof(struct simple_linked_list_s));
|
|
25
|
+
simple_linked_list_insert_before(tail, s, e);
|
|
26
|
+
tail = s;
|
|
27
|
+
s = calloc(1, sizeof(struct simple_linked_list_s));
|
|
28
|
+
simple_linked_list_insert_before(tail, s, d);
|
|
29
|
+
|
|
30
|
+
s = head;
|
|
31
|
+
while(s) {
|
|
32
|
+
if(s && s->value && s->value != NULL)
|
|
33
|
+
printf("%s\n", (u8 *)s->value);
|
|
34
|
+
s = s->next;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
simple_linked_list.h -- *Full Library* Header File
|
|
4
|
+
|
|
5
|
+
Used to create simple linked lists
|
|
6
|
+
|
|
7
|
+
See the end of this file for an example.
|
|
8
|
+
|
|
9
|
+
Public Functions:
|
|
10
|
+
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
#ifndef SIMPLE_LINKED_LIST_H_Minaswan /* Prevent multiple inclusions */
|
|
14
|
+
#define SIMPLE_LINKED_LIST_H_Minaswan
|
|
15
|
+
#ifndef TYPEDEFS_H_Minaswan /* Header guard for typedefs.h */
|
|
16
|
+
#define TYPEDEFS_H_Minaswan
|
|
17
|
+
|
|
18
|
+
#endif /* TYPEDEFS_H_Minaswan */
|
|
19
|
+
|
|
20
|
+
struct simple_linked_list_s {
|
|
21
|
+
struct simple_linked_list_s *next;
|
|
22
|
+
#ifdef SIMPLE_DOUBLE_LINKED_LIST
|
|
23
|
+
struct simple_linked_list_s *previous;
|
|
24
|
+
#endif
|
|
25
|
+
void *value;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/* Public Functions */
|
|
29
|
+
|
|
30
|
+
#ifdef SIMPLE_LINKED_LIST_IMPLEMENTATION
|
|
31
|
+
void simple_linked_list_init(struct simple_linked_list_s *s, void *value)
|
|
32
|
+
{
|
|
33
|
+
#ifdef SIMPLE_DOUBLE_LINKED_LIST
|
|
34
|
+
s->previous = s->next = NULL;
|
|
35
|
+
#endif
|
|
36
|
+
s->value = value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
void simple_linked_list_insert_after(struct simple_linked_list_s *position,
|
|
40
|
+
struct simple_linked_list_s *s, void *value)
|
|
41
|
+
{
|
|
42
|
+
s->value = value;
|
|
43
|
+
s->next = position->next;
|
|
44
|
+
#ifdef SIMPLE_DOUBLE_LINKED_LIST
|
|
45
|
+
s->previous = position;
|
|
46
|
+
if(position->next != NULL)
|
|
47
|
+
position->next->previous = s;
|
|
48
|
+
#endif
|
|
49
|
+
position->next = s;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
void simple_linked_list_insert_before(struct simple_linked_list_s *position,
|
|
53
|
+
struct simple_linked_list_s *s, void *value)
|
|
54
|
+
{
|
|
55
|
+
s->value = value;
|
|
56
|
+
s->next = position;
|
|
57
|
+
#ifdef SIMPLE_DOUBLE_LINKED_LIST
|
|
58
|
+
s->previous = position->previous;
|
|
59
|
+
if(position->previous != NULL)
|
|
60
|
+
position->previous->next = s;
|
|
61
|
+
position->previous = s;
|
|
62
|
+
#endif
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
#ifdef SIMPLE_DOUBLE_LINKED_LIST
|
|
66
|
+
void simple_linked_list_remove(struct simple_linked_list_s *s)
|
|
67
|
+
{
|
|
68
|
+
if(s->previous)
|
|
69
|
+
s->previous->next = s->next;
|
|
70
|
+
if(s->next)
|
|
71
|
+
s->next->previous = s->previous;
|
|
72
|
+
s->previous = s->next = NULL;
|
|
73
|
+
}
|
|
74
|
+
#endif
|
|
75
|
+
|
|
76
|
+
#endif /* SIMPLE_LINKED_LIST_IMPLEMENTATION */
|
|
77
|
+
#endif /* SIMPLE_LINKED_LIST_H_Minaswan */
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
Example:
|
|
81
|
+
|
|
82
|
+
#define SIMPLE_LINKED_LIST_IMPLEMENTATION
|
|
83
|
+
#include "simple_linked_list.h"
|
|
84
|
+
|
|
85
|
+
struct simple_linked_list_s s;
|
|
86
|
+
c8 *a = "a", *b = "b", *c = "c";
|
|
87
|
+
|
|
88
|
+
simple_linked_list_init(&s, a);
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
smart_alloc.h -- *Full Library* Header File
|
|
4
|
+
|
|
5
|
+
For smart alloc
|
|
6
|
+
|
|
7
|
+
See the end of this file for an example.
|
|
8
|
+
|
|
9
|
+
Public Functions:
|
|
10
|
+
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
#ifndef SMART_ALLOC_H_Minaswan /* Prevent multiple inclusions */
|
|
14
|
+
#define SMART_ALLOC_H_Minaswan
|
|
15
|
+
#ifndef TYPEDEFS_H_Minaswan /* Header guard for typedefs.h */
|
|
16
|
+
#define TYPEDEFS_H_Minaswan
|
|
17
|
+
|
|
18
|
+
#endif /* TYPEDEFS_H_Minaswan */
|
|
19
|
+
|
|
20
|
+
struct smart_alloc_data_s {
|
|
21
|
+
struct smart_alloc_data_s *next;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
struct smart_alloc_s {
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/* Public Functions */
|
|
28
|
+
|
|
29
|
+
#ifdef SMART_ALLOC_IMPLEMENTATION
|
|
30
|
+
|
|
31
|
+
#endif /* SMART_ALLOC_IMPLEMENTATION */
|
|
32
|
+
#endif /* SMART_ALLOC_H_Minaswan */
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
Example:
|
|
36
|
+
|
|
37
|
+
#define SMART_ALLOC_IMPLEMENTATION
|
|
38
|
+
#include "smart_alloc.h"
|
|
39
|
+
|
|
40
|
+
i32 arena = smart_alloc_create(0);
|
|
41
|
+
|
|
42
|
+
smart_alloc(arena, size, align)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
*/
|
data/lib/data/libsrc/typedefs.h
CHANGED
|
File without changes
|
|
@@ -1,6 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
# defaults to only removing the object directory
|
|
2
|
+
if(@clean_includes_binary_directory == true && @clean_includes_library_directory == true)
|
|
3
|
+
@clean_target = <<-END_OF_STRING
|
|
2
4
|
.PHONY : clean
|
|
3
5
|
clean :
|
|
4
6
|
\t@echo "#{@emoji_clean} Removed |Yeverything|n from |R$(OBJECT)|n, |R$(BINARY)|n, and |R$(LIBRARY)|n directories"
|
|
5
7
|
\t@rm -rf $(OBJECT) $(BINARY) $(LIBRARY)
|
|
6
8
|
END_OF_STRING
|
|
9
|
+
elsif(@clean_includes_binary_directory == true)
|
|
10
|
+
@clean_target = <<-END_OF_STRING
|
|
11
|
+
.PHONY : clean
|
|
12
|
+
clean :
|
|
13
|
+
\t@echo "#{@emoji_clean} Removed |Yeverything|n from |R$(OBJECT)|n and |R$(BINARY)|n directories"
|
|
14
|
+
\t@rm -rf $(OBJECT) $(BINARY) $(LIBRARY)
|
|
15
|
+
END_OF_STRING
|
|
16
|
+
elsif(@clean_includes_library_directory == true)
|
|
17
|
+
@clean_target = <<-END_OF_STRING
|
|
18
|
+
.PHONY : clean
|
|
19
|
+
clean :
|
|
20
|
+
\t@echo "#{@emoji_clean} Removed |Yeverything|n from |R$(OBJECT)|n and |R$(LIBRARY)|n directories"
|
|
21
|
+
\t@rm -rf $(OBJECT) $(BINARY) $(LIBRARY)
|
|
22
|
+
END_OF_STRING
|
|
23
|
+
else
|
|
24
|
+
@clean_target = <<-END_OF_STRING
|
|
25
|
+
.PHONY : clean
|
|
26
|
+
clean :
|
|
27
|
+
\t@echo "#{@emoji_clean} Removed |Yeverything|n from |R$(OBJECT)|n directory"
|
|
28
|
+
\t@rm -rf $(OBJECT)
|
|
29
|
+
END_OF_STRING
|
|
30
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: demake
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Minaswan Nakamoto
|
|
@@ -115,6 +115,10 @@ files:
|
|
|
115
115
|
- lib/data/libsrc/fast_sha2.h
|
|
116
116
|
- lib/data/libsrc/parse_arguments.h
|
|
117
117
|
- lib/data/libsrc/rb_library.c
|
|
118
|
+
- lib/data/libsrc/simple_linked_list
|
|
119
|
+
- lib/data/libsrc/simple_linked_list.c
|
|
120
|
+
- lib/data/libsrc/simple_linked_list.h
|
|
121
|
+
- lib/data/libsrc/smart_alloc.h
|
|
118
122
|
- lib/data/libsrc/typedefs.h
|
|
119
123
|
- lib/template/build_target.rb
|
|
120
124
|
- lib/template/clean_target.rb
|
|
@@ -148,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
148
152
|
- !ruby/object:Gem::Version
|
|
149
153
|
version: '0'
|
|
150
154
|
requirements: []
|
|
151
|
-
rubygems_version: 4.0.
|
|
155
|
+
rubygems_version: 4.0.10
|
|
152
156
|
specification_version: 4
|
|
153
157
|
summary: Develop, Decorate and manage Dependencies for C (GNU) Makefiles easily with
|
|
154
158
|
a Ruby script.
|