forked from SeraphYuki/zimedit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·89 lines (74 loc) · 2.33 KB
/
Makefile
File metadata and controls
executable file
·89 lines (74 loc) · 2.33 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
## wish i knew make, uncomment for library compile comment everything else
#EXECUTABLE=libthoth.a
#CC=gcc
#EXECUTABLE=libthoth.a
#CFLAGS = -g -Wall -lm -DSDL_COMPILE -DLIBRARY_COMPILE -DLINUX_COMPILE\
#$(shell pkg-config --cflags sdl3) $(shell pkg-config --cflags freetype2)
#
#SOURCES=main.c text_editor.c window.c graphics.c log.c freetype.c file_browser.c config.c
#OBJECTS=$(SOURCES:.c=.o)
#
#
#all: $(SOURCES) $(EXECUTABLE)
#
#$(EXECUTABLE): $(OBJECTS)
# ar -rc $@ $(OBJECTS)
#
#.c.o:
# $(CC) -c $(CFLAGS) $< -o $@
#
#clean:
# rm *.o
#
#
# # linux / BSD
CC=gcc
EXECUTABLE=zim
CFLAGS = -g -Wall -lm -DLINUX_COMPILE -DSDL_COMPILE $(shell pkg-config --cflags sdl3) \
$(shell pkg-config --cflags freetype2) -DLINUX_INSTALL
FREETYPELIBS = $(shell pkg-config --libs freetype2)
GLEWLIBS = $(shell pkg-config --libs glew)
SDLLIBS = $(shell pkg-config --libs sdl3)
LDLIBS = -lm -lutil $(GLEWLIBS) $(SDLLIBS) $(FREETYPELIBS)
# CC=x86_64-w64-mingw32-gcc
# EXECUTABLE=zim.exe
#
# FREETYPELIBS = -lfreetype
#CFLAGS = -g -Wall -lm -DWINDOWS_COMPILE -DSDL2_COMPILE -DSDL_COMPILE \
#$(shell x86_64-w64-mingw32-pkg-config --cflags sdl2) \
#$(shell x86_64-w64-mingw32-pkg-config --cflags freetype2)
#
#GLEWLIBS = -lglew32 -lopengl32 -mwindows -Lglu32
#
# SDLLIBS = $(shell x86_64-w64-mingw32-pkg-config --libs sdl2)
#LDLIBS = -lm -lmingw32 $(SDLLIBS) $(GLEWLIBS) $(FREETYPELIBS)
# add -pg for gdb
# windows
# CC=mingw32-gcc
# EXECUTABLE=zim.exe
# CFLAGS = -DWINDOWS_COMPILE \
#-IC:/MinGW/include/freetype2/ -IC:/MinGW/include/
#
# LDLIBS = -m32 -lmingw32 -lSDL3 -mwindows -lm -lkernel32 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lversion -luuid -ladvapi32 -lsetupapi -lshell32 -ldinput8 \
# -lglew32 -lglu32 -lopengl32 \
# -lfreetype -lz -lpng
#
## LIBS = -Wl,-Bdynamic -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lglew32 -Wl,-Bstatic -lpng16 -lz -lm -Llib/freetype/lib/win_cb/ -lfreetype
#
SOURCES=main.c \
text_editor.c window.c graphics.c log.c freetype.c file_browser.c config.c json.c
OBJECTS=$(SOURCES:.c=.o)
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(OBJECTS) $(LDLIBS) -o $@
#wihndows unused right now
#all: createResourcesO $(SOURCES) $(EXECUTABLE)
# $(EXECUTABLE): $(OBJECTS) icon.o
# $(CC) $(OBJECTS) icon.o $(LDLIBS) -o $@
# createResourcesO: icon.rc
# windres icon.rc -o icon.o
#
.c.o:
$(CC) -c $(CFLAGS) $< -o $@
clean:
rm *.o