This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
forked from pingflood/gmenunx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.linux
64 lines (47 loc) · 1.83 KB
/
Makefile.linux
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
PLATFORM := linux
BUILDTIME := $(shell date +%s)
CC := gcc
CXX := g++
STRIP := strip
SYSROOT := $(shell $(CC) --print-sysroot)
SDL_CFLAGS := $(shell $(SYSROOT)/usr/bin/sdl-config --cflags)
SDL_LIBS := $(shell $(SYSROOT)/usr/bin/sdl-config --libs)
CFLAGS = -DPLATFORM=\"$(PLATFORM)\" -D__BUILDTIME__="$(BUILDTIME)" -DLOG_LEVEL=4
CFLAGS += -O0 -ggdb -g -pg $(SDL_CFLAGS)
CFLAGS += -Wundef -Wno-deprecated -Wno-unknown-pragmas -Wno-format -Wno-narrowing
CFLAGS += -Isrc -Isrc/libopk
CFLAGS += -DTARGET_LINUX -DHW_TVOUT -DHW_UDC -DHW_EXT_SD -DHW_SCALER -DOPK_SUPPORT -DIPK_SUPPORT
LDFLAGS = -Wl,-Bstatic -Lsrc/libopk -l:libopk.a
LDFLAGS += -Wl,-Bdynamic -lz $(SDL_LIBS) -lSDL_image -lSDL_ttf
OBJDIR = /tmp/gmenu2x/$(PLATFORM)
DISTDIR = dist/$(PLATFORM)
TARGET = dist/$(PLATFORM)/gmenu2x
SOURCES := $(wildcard src/*.cpp)
OBJS := $(patsubst src/%.cpp, $(OBJDIR)/src/%.o, $(SOURCES))
# File types rules
$(OBJDIR)/src/%.o: src/%.cpp src/%.h src/platform/linux.h
$(CXX) $(CFLAGS) -o $@ -c $<
-include $(patsubst src/%.cpp, $(OBJDIR)/src/%.d, $(SOURCES))
all: dir libopk shared
dir:
@mkdir -p $(OBJDIR)/src dist/$(PLATFORM)
libopk:
make -C src/libopk clean
make -C src/libopk
debug: $(OBJS)
@echo "Linking gmenu2x-debug..."
$(CXX) -o $(TARGET)-debug $(OBJS) $(LDFLAGS)
shared: debug
$(STRIP) $(TARGET)-debug -o $(TARGET)
clean:
make -C src/libopk clean
rm -rf $(OBJDIR) $(DISTDIR) *.gcda *.gcno $(TARGET) $(TARGET)-debug
dist: dir libopk shared
install -m644 -D README.md $(DISTDIR)/README.txt
install -m644 -D COPYING $(DISTDIR)/COPYING
install -m644 -D ChangeLog.md $(DISTDIR)/ChangeLog
cp -RH assets/translations $(DISTDIR)
cp -RH assets/skins $(DISTDIR)
cp -RH assets/$(PLATFORM)/input.conf $(DISTDIR)
zip: dist
cd $(DISTDIR)/ && zip -r ../gmenunx.$(PLATFORM).zip skins translations ChangeLog COPYING gmenu2x input.conf README.txt