improve gexit with init function and add basic mlx image gestion

This commit is contained in:
Hugo LAMY
2022-03-25 18:49:06 +01:00
parent 3a1036ccdc
commit 02b5d88ea5
45 changed files with 139 additions and 7042 deletions

View File

@@ -0,0 +1,34 @@
MODULE_SRC= mlx_image.swift mlx_window.swift mlx_init.swift
MODULE_OBJ=$(MODULE_SRC:.swift=.swiftmodule)
SRC= interface.swift $(MODULE_SRC)
OBJ=$(SRC:.swift=.o)
C_SRC= mlx_xpm.c mlx_png.c mlx_string_put.c
C_OBJ=$(C_SRC:.c=.o)
CFLAGS=-O3
NAME=libmlx.dylib
INC=-I.
#OPTI=-Ounchecked
all: $(NAME)
$(NAME): $(MODULE_OBJ) $(OBJ) $(C_OBJ)
swiftc $(OPTI) $(INC) -o $(NAME) -emit-library $(OBJ) $(C_OBJ) -lz
%.o: %.swift
swiftc $(OPTI) $(INC) -parse-as-library -c $< -o $@
%.swiftmodule: %.swift
swiftc $(OPTI) $(INC) -parse-as-library -c $< -o $@ -emit-module -module-name $(patsubst %.swift,%,$<) -module-link-name $(patsubst %.swift,%,$<)
clean:
rm -f $(NAME) $(OBJ) $(MODULE_OBJ) $(C_OBJ) *.swiftdoc *~