-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup build system and directory structure
- Loading branch information
Showing
30 changed files
with
315 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,5 +1,4 @@ | |||
*.o | *.o | ||
*.so | |||
cscope.out | cscope.out | ||
tags | tags | ||
out | out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,45 @@ | |||
# Latehooks (experimental) | |||
LATEHOOKS ?= 1 | |||
|
|||
# Debug build (logging + debug symbols) | |||
DEBUG ?= 0 | |||
|
|||
# Destination directory when installing (used for packaging) | |||
DESTDIR ?= / | |||
|
|||
# Destination prefix when installing | |||
PREFIX ?= /usr | |||
|
|||
# Target platform | |||
PLATFORM ?= harmattan | |||
|
|||
# Set to 1 for verbose compile output | |||
V ?= 0 | |||
|
|||
# Default linker flags | |||
LDFLAGS += -fPIC -pthread -ldl -lz -lpng -ljpeg | |||
|
|||
|
|||
ifeq ($(LATEHOOKS),1) | |||
CFLAGS += -DAPKENV_LATEHOOKS | |||
endif | |||
|
|||
ifeq ($(DEBUG),1) | |||
CFLAGS += -g -Wall -DLINKER_DEBUG=1 -DAPKENV_DEBUG -Wformat=0 | |||
else | |||
CFLAGS += -O2 -DLINKER_DEBUG=0 | |||
endif | |||
|
|||
ifeq ($(V),1) | |||
SILENTMSG := @true | |||
SILENTCMD := | |||
else | |||
SILENTMSG := @echo | |||
SILENTCMD := @ | |||
endif | |||
|
|||
|
|||
# Expose some makefile variables as C macros | |||
CFLAGS += -DAPKENV_PREFIX=\"$(PREFIX)\" | |||
CFLAGS += -DAPKENV_TARGET=\"$(TARGET)\" | |||
CFLAGS += -DAPKENV_PLATFORM=\"$(PLATFORM)\" |
File renamed without changes.
File renamed without changes.
0
libs/libdvm_compat.so → libs/harmattan/libdvm_compat.so
100755 → 100644
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,141 +1,63 @@ | |||
TARGET := apkenv | |||
|
|
||
# Android Gingerbread linker | # Default target, make sure this is always first | ||
LINKER_SOURCES=$(wildcard linker/*.c) | all: $(TARGET) modules | ||
|
|
||
# Compatibility wrappers and hooks | # Build configuration | ||
COMPAT_SOURCES=$(wildcard compat/*.c) | include config.mk | ||
|
|
||
# Library for getting files out of .apk files | SOURCES := $(TARGET).c | ||
APKLIB_SOURCES=$(wildcard apklib/*.c) | SOURCES += $(wildcard linker/*.c) | ||
SOURCES += $(wildcard compat/*.c) | |||
SOURCES += $(wildcard apklib/*.c) | |||
SOURCES += $(wildcard jni/*.c) | |||
SOURCES += $(wildcard imagelib/*.c) | |||
SOURCES += $(wildcard debug/*.c) | |||
SOURCES += $(wildcard debug/wrappers/*.c) | |||
|
|
||
# Our own JNI environment implementation | # Platform-specific targets and configuration | ||
JNIENV_SOURCES=$(wildcard jni/*.c) | PLATFORM_INSTALL_TARGETS := | ||
include platform/$(PLATFORM).mk | |||
|
|
||
# Support modules for specific applications | OBJS := $(patsubst %.c,%.o,$(SOURCES)) | ||
MODULES_SOURCES=$(wildcard modules/*.c) | |||
|
|||
# JPEG and PNG loaders | |||
IMAGELIB_SOURCES=$(wildcard imagelib/*.c) | |||
|
|||
# segfault catch | |||
DEBUG_SOURCES=$(wildcard debug/*.c) | |||
|
|||
# debug wrappers | |||
WRAPPER_SOURCES=$(wildcard debug/wrappers/*.c) | |||
|
|||
TARGET = apkenv | |||
|
|||
# we need objdump for getting a disassembly of the debug-wrappers | |||
OBJDUMP ?= objdump | |||
|
|||
# enable latehooks | |||
LATEHOOKS ?= 1 | |||
|
|||
ifeq ($(LATEHOOKS),1) | |||
CFLAGS += -DLATEHOOKS | |||
endif | |||
|
|||
DESTDIR ?= / | |||
PREFIX ?= /opt/$(TARGET)/ | |||
BIONIC_LIBS = $(wildcard libs/*.so) | |||
|
|||
SOURCES += $(TARGET).c | |||
SOURCES += $(LINKER_SOURCES) | |||
SOURCES += $(COMPAT_SOURCES) | |||
SOURCES += $(APKLIB_SOURCES) | |||
SOURCES += $(JNIENV_SOURCES) | |||
SOURCES += $(IMAGELIB_SOURCES) | |||
SOURCES += $(DEBUG_SOURCES) | |||
SOURCES += $(WRAPPER_SOURCES) | |||
|
|||
PANDORA ?= 0 | |||
ifeq ($(PANDORA),1) | |||
SOURCES += platform/pandora.c | |||
else | |||
SOURCES += platform/maemo.c | |||
endif | |||
|
|
||
OBJS = $(patsubst %.c,%.o,$(SOURCES)) | # Support modules for specific applications | ||
MODULES = $(patsubst modules/%.c,%.apkenv.so,$(MODULES_SOURCES)) | MODULES_SOURCES := $(wildcard modules/*.c) | ||
|
MODULES := $(patsubst modules/%.c,%.apkenv.so,$(MODULES_SOURCES)) | ||
LDFLAGS = -fPIC -ldl -lz -lSDL -lSDL_mixer -pthread -lpng -ljpeg | |||
|
|||
ifeq ($(PANDORA),1) | |||
CFLAGS += -DPANDORA | |||
LDFLAGS += -lrt | |||
endif | |||
|
|||
# Selection of OpenGL ES version support (if any) to include | |||
CFLAGS += -DAPKENV_GLES | |||
LDFLAGS += -lGLES_CM | |||
CFLAGS += -DAPKENV_GLES2 | |||
LDFLAGS += -lGLESv2 -lEGL | |||
|
|||
FREMANTLE ?= 0 | |||
ifeq ($(FREMANTLE),1) | |||
CFLAGS += -DFREMANTLE | |||
LDFLAGS += -lSDL_gles | |||
endif | |||
|
|
||
DEBUG ?= 0 | modules: $(MODULES) | ||
ifeq ($(DEBUG),1) | |||
CFLAGS += -g -Wall -DLINKER_DEBUG=1 -DAPKENV_DEBUG -Wformat=0 | |||
else | |||
CFLAGS += -O2 -DLINKER_DEBUG=0 | |||
endif | |||
|
|
||
all: $(TARGET) $(MODULES) | $(TARGET): $(OBJS) | ||
$(SILENTMSG) -e "\tLINK\t$@" | |||
$(SILENTCMD)$(CC) $(LDFLAGS) $(OBJS) -o $@ | |||
|
|
||
debug/wrappers/%_thumb.o: debug/wrappers/%_thumb.c | debug/wrappers/%_thumb.o: debug/wrappers/%_thumb.c | ||
@echo -e "\tCC (TH)\t$@" | $(SILENTMSG) -e "\tCC (TH)\t$@" | ||
@$(CC) -mthumb -O0 -c -o $@ $< | $(SILENTCMD)$(CC) -mthumb -O0 -c -o $@ $< | ||
|
|
||
debug/wrappers/%_arm.o: debug/wrappers/%_arm.c | debug/wrappers/%_arm.o: debug/wrappers/%_arm.c | ||
@echo -e "\tCC\t$@" | $(SILENTMSG) -e "\tCC\t$@" | ||
@$(CC) -marm -O0 -c -o $@ $< | $(SILENTCMD)$(CC) -marm -O0 -c -o $@ $< | ||
|
|
||
%.o: %.c | %.o: %.c | ||
@echo -e "\tCC\t$@" | $(SILENTMSG) -e "\tCC\t$@" | ||
@$(CC) $(CFLAGS) -c -o $@ $< | $(SILENTCMD)$(CC) $(CFLAGS) -c -o $@ $< | ||
|
|||
$(TARGET): $(OBJS) | |||
@echo -e "\tLINK\t$@" | |||
@$(CC) $(LDFLAGS) $(OBJS) -o $@ | |||
|
|
||
%.apkenv.so: modules/%.c | %.apkenv.so: modules/%.c | ||
@echo -e "\tMOD\t$@" | $(SILENTMSG) -e "\tMOD\t$@" | ||
@$(CC) -fPIC -shared $(CFLAGS) -o $@ $< | $(SILENTCMD)$(CC) -fPIC -shared $(CFLAGS) -o $@ $< | ||
|
|
||
strip: | install: $(TARGET) $(MODULES) $(PLATFORM_INSTALL_TARGETS) | ||
@echo -e "\tSTRIP" | $(SILENTMSG) -e "\tINSTALL\t$(TARGET)" | ||
@strip $(TARGET) $(MODULES) | $(SILENTCMD)mkdir -p $(DESTDIR)$(PREFIX)/bin | ||
|
$(SILENTCMD)install -m755 $(TARGET) $(DESTDIR)$(PREFIX)/bin | ||
install: $(TARGET) $(MODULES) | $(SILENTMSG) -e "\tINSTALL\tMODULES" | ||
@echo -e "\tMKDIR" | $(SILENTCMD)mkdir -p $(DESTDIR)$(PREFIX)/lib/$(TARGET)/modules | ||
@mkdir -p $(DESTDIR)$(PREFIX)/{modules,bionic} | $(SILENTCMD)install -m644 $(MODULES) $(DESTDIR)$(PREFIX)/lib/$(TARGET)/modules | ||
@mkdir -p $(DESTDIR)/usr/bin | |||
@echo -e "\tINSTALL\t$(TARGET)" | |||
@install -m755 $(TARGET) $(DESTDIR)/usr/bin | |||
@echo -e "\tINSTALL\tMODULES" | |||
@install -m644 $(MODULES) $(DESTDIR)$(PREFIX)/modules | |||
ifneq ($(PANDORA),1) | |||
@echo -e "\tINSTALL\tBIONIC" | |||
@install -m644 $(BIONIC_LIBS) $(DESTDIR)$(PREFIX)/bionic | |||
ifneq ($(FREMANTLE),1) | |||
@echo -e "\tINSTALL\tHarmattan Resource Policy" | |||
@install -d -m755 $(DESTDIR)/usr/share/policy/etc/syspart.conf.d | |||
@install -m644 $(TARGET).conf $(DESTDIR)/usr/share/policy/etc/syspart.conf.d | |||
endif | |||
else | |||
@echo -e "\tINSTALL\tlibs" | |||
@mkdir -p $(DESTDIR)$(PREFIX)/system/lib | |||
@install -m644 libs/pandora/system/lib/*.so $(DESTDIR)$(PREFIX)/system/lib/ | |||
endif | |||
|
|
||
clean: | clean: | ||
@echo -e "\tCLEAN" | $(SILENTMSG) -e "\tCLEAN" | ||
@rm -rf $(TARGET) $(OBJS) $(MODULES) | $(SILENTCMD)rm -rf $(TARGET) $(OBJS) $(MODULES) | ||
|
|
||
.DEFAULT: all | .DEFAULT: all | ||
.PHONY: strip install clean | .PHONY: all modules install clean | ||
|
Oops, something went wrong.