-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
46 lines (38 loc) · 1.29 KB
/
Makefile
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
TARGET := rombundler
VERSION ?= devel
ifeq ($(shell uname -s),) # win
TARGET := rombundler.exe
LDFLAGS += -L./lib -lglfw3dll -lOpenal32.dll -mwindows
OS ?= Windows
else ifneq ($(findstring MINGW,$(shell uname -s)),) # win
TARGET := rombundler.exe
LDFLAGS += -L./lib -lglfw3dll -lOpenal32.dll -mwindows
OS ?= Windows
else ifneq ($(findstring Darwin,$(shell uname -s)),) # osx
LDFLAGS := -Ldeps/osx_$(shell uname -m)/lib -lglfw3 -framework Cocoa -framework OpenGL -framework IOKit
LDFLAGS += -framework OpenAL
OS ?= OSX
else
LDFLAGS := -ldl
LDFLAGS += $(shell pkg-config --libs glfw3)
LDFLAGS += $(shell pkg-config --libs openal)
OS ?= Linux
endif
CFLAGS += -Wall -O3 -fPIC -flto -I. -Iinclude -Ideps/include
OBJ = main.o glad.o config.o core.o audio.o video.o input.o options.o ini.o utils.o srm.o
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
.PHONY: all clean
all: $(TARGET)
$(TARGET): $(OBJ)
$(CC) -o $@ $^ $(LDFLAGS) -flto
bundle: $(TARGET)
mkdir -p ROMBundler-$(OS)-$(VERSION)
cp $(TARGET) ROMBundler-$(OS)-$(VERSION)
cp *.dll ROMBundler-$(OS)-$(VERSION) || :
cp config.ini ROMBundler-$(OS)-$(VERSION)
cp README.md ROMBundler-$(OS)-$(VERSION)
cp COPYING ROMBundler-$(OS)-$(VERSION)
zip -r ROMBundler-$(OS)-$(VERSION).zip ROMBundler-$(OS)-$(VERSION)
clean:
rm -rf $(OBJ) $(TARGET) ROMBundler-*