File size: 1,593 Bytes
e8ac98a
 
 
 
 
 
 
 
0a7b47e
e8ac98a
 
 
 
 
 
 
 
 
 
 
 
 
 
d7df8d0
e8ac98a
 
 
 
 
 
 
 
d7df8d0
e8ac98a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# makefile for building and running the application

.PHONY: all cutils ctrain cpostman converter run clean

# default target to build all components
all: cutils ctrain cpostman

# build Cython extensions in restful/cutils
cutils:
	@echo "Building Cython extensions in restful/cutils..."
	@cd restful/cutils && python setup.py build_ext --inplace


# build Cython extensions in training
ctrain:
	@echo "Building Cython extensions in training..."
	@cd training && python setup.py build_ext --inplace


# build Cython extensions in postman
cpostman:
	@echo "Building Cython extensions in postman..."
	@cd postman && python setup.py build_ext --inplace


# run the converter script
converter:
	@echo "Running converter script..."
	@python postman/converter.py


# run the application with uvicorn
run:
	@echo "Starting the application..."
	@uvicorn app:app --host 0.0.0.0 --port 7860 --reload


# clean up build artifacts
clean:
	@echo "Cleaning up build artifacts..."
	@find . -type f -name "*.so" -delete
	@find . -type f -name "*.c" -delete
	@find . -type f -name "*.cpp" -delete
	@find . -type d -name "__pycache__" -exec rm -r {} +


# help message
help:
	@echo "Usage:"
	@echo "  make all       - Build all Cython extensions"
	@echo "  make cutils    - Build Cython extensions in restful/cutils"
	@echo "  make ctrain    - Build Cython extensions in training"
	@echo "  make cpostman  - Build Cython extensions in postman"
	@echo "  make converter - Run the converter script"
	@echo "  make run       - Start the application with Uvicorn"
	@echo "  make clean     - Remove build artifacts"