<commit_before>.PHONY: clean

pwd = $(shell pwd)

.build/VaporApp: .build/libVapor.so Sources/VaporDev/main.swift Sources/VaporDev/**/*.swift
	swiftc Sources/VaporDev/**.swift -I .build -L .build -lVapor -lJay -lHummingbird -llibc -lStrand -Xlinker -rpath -Xlinker $(pwd)/.build -o .build/VaporApp

run: .build/VaporApp
	.build/VaporApp
	
.build/libVapor.so: .build/libHummingbird.so .build/libJay.so .build/liblibc.so
	cd .build; \
	swiftc ../Sources/Vapor/**/*.swift -emit-library -emit-module -module-name Vapor -I . -L .

.build/liblibc.so: 
	cd .build; \
	swiftc ../Sources/libc/*.swift -emit-library -emit-module -module-name libc -I . -L .

.build/libJay.so: Packages/Jay/Sources/Jay/*.swift
	cd .build; \
	swiftc ../Packages/Jay/Sources/Jay/*.swift -emit-library -emit-module -module-name Jay -I . -L .

.build/libHummingbird.so: .build/libStrand.so Packages/Hummingbird/Sources/*.swift
	cd .build; \
	swiftc ../Packages/Hummingbird/Sources/*.swift -emit-library -emit-module -module-name Hummingbird -I . -L . 

.build/libStrand.so: Packages/Strand/Sources/*.swift
	mkdir .build; \
	cd .build; \
	swiftc ../Packages/Strand/Sources/*.swift -emit-library -emit-module -module-name Strand

Packages/Strand/Sources/*.swift:
	git clone https://github.com/ketzusaka/Strand Packages/Strand;

Packages/Jay/Sources/Jay/*.swift:
	git clone https://github.com/qutheory/json Packages/Jay

Packages/Hummingbird/Sources/*.swift:
	git clone https://github.com/ketzusaka/Hummingbird Packages/Hummingbird

.build:
	mkdir .build

clean:
	rm -rf Packages
	rm -rf .build
<commit_msg>add os x compilation support<commit_after>.PHONY: clean

OS = $(shell uname)
PWD = $(shell pwd)

ifeq "$(OS)" "Darwin"
	SWIFTC = xcrun -sdk macosx swiftc
	LIBHUMMINGBIRD = .build/libHummingbird.dylib
	LIBJAY = .build/libJay.dylib
	LIBSTRAND = .build/libStrand.dylib
	LIBLIBC = .build/liblibc.dylib
	LIBVAPOR = .build/libVapor.dylib
else
	SWIFTC = swiftc
	LIBHUMMINGBIRD = .build/libHummingbird.so
	LIBJAY = .build/libJay.so
	LIBSTRAND = .build/libStrand.so
	LIBLIBC = .build/liblibc.so
	LIBVAPOR = .build/libVapor.so
endif


.build/VaporApp: $(LIBVAPOR) Sources/VaporDev/main.swift Sources/VaporDev/**/*.swift
	$(SWIFTC) Sources/VaporDev/**.swift -I .build -L .build -lVapor -lJay -lHummingbird -llibc -lStrand -Xlinker -rpath -Xlinker $(PWD)/.build -o .build/VaporApp

run: .build/VaporApp
	.build/VaporApp
	
$(LIBVAPOR): $(LIBHUMMINGBIRD) $(LIBJAY) $(LIBLIBC)
	cd .build; \
	$(SWIFTC) ../Sources/Vapor/**/*.swift -emit-library -emit-module -module-name Vapor -I . -L . -lJay -lHummingbird -llibc -lStrand

$(LIBLIBC): 
	cd .build; \
	$(SWIFTC) ../Sources/libc/*.swift -emit-library -emit-module -module-name libc -I . -L .

$(LIBJAY): Packages/Jay/Sources/Jay/*.swift
	cd .build; \
	$(SWIFTC) ../Packages/Jay/Sources/Jay/*.swift -emit-library -emit-module -module-name Jay -I . -L .

$(LIBHUMMINGBIRD): $(LIBSTRAND) Packages/Hummingbird/Sources/*.swift
	cd .build; \
	$(SWIFTC) ../Packages/Hummingbird/Sources/*.swift -emit-library -emit-module -module-name Hummingbird -I . -L . -lStrand

$(LIBSTRAND): Packages/Strand/Sources/*.swift
	mkdir .build; \
	cd .build; \
	$(SWIFTC) ../Packages/Strand/Sources/*.swift -emit-library -emit-module -module-name Strand

Packages/Strand/Sources/*.swift:
	git clone https://github.com/ketzusaka/Strand Packages/Strand;

Packages/Jay/Sources/Jay/*.swift:
	git clone https://github.com/qutheory/json Packages/Jay

Packages/Hummingbird/Sources/*.swift:
	git clone https://github.com/ketzusaka/Hummingbird Packages/Hummingbird

.build:
	mkdir .build

clean:
	rm -rf Packages
	rm -rf .build

{'fraction_non_alphanumeric': 0.16421228118921924, 'fraction_numerical': 0.0, 'mean_word_length': 3.3848964677222897, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3444553', 'n_tokens_mistral': 1539, 'n_tokens_neox': 1426, 'n_words': 276}