diff --git a/src/batmon/makefile b/src/batmon/makefile index 498944e..71b0911 100644 --- a/src/batmon/makefile +++ b/src/batmon/makefile @@ -1,14 +1,35 @@ +.PHONY: all +.PHONY: clean + +TARGET=batmon + +########################################################### + ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif -TARGET = batmon +########################################################### + +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif CC = $(CROSS_COMPILE)gcc -CFLAGS = -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve -LDFLAGS = -lSDL -lSDL_image -lpthread +LIBS = -lSDL -lSDL_image -lpthread + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 +CFLAGS += $(LIBS) all: - $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) $(LDFLAGS) + $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) + clean: - rm -f $(TARGET) \ No newline at end of file + rm -f $(TARGET) diff --git a/src/blank/main.c b/src/blank/blank.c similarity index 100% rename from src/blank/main.c rename to src/blank/blank.c diff --git a/src/blank/makefile b/src/blank/makefile index 73b992c..754722a 100644 --- a/src/blank/makefile +++ b/src/blank/makefile @@ -1,14 +1,33 @@ +.PHONY: all +.PHONY: clean + +TARGET=blank + +########################################################### + ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif -TARGET = blank +########################################################### + +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif CC = $(CROSS_COMPILE)gcc -CFLAGS = -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve -LDFLAGS = + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 all: - $(CC) main.c -o $(TARGET) $(CFLAGS) $(LDFLAGS) + $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) + clean: - rm -f $(TARGET) \ No newline at end of file + rm -f $(TARGET) diff --git a/src/clock/main.c b/src/clock/clock.c similarity index 100% rename from src/clock/main.c rename to src/clock/clock.c diff --git a/src/clock/makefile b/src/clock/makefile index 88438fb..376a923 100644 --- a/src/clock/makefile +++ b/src/clock/makefile @@ -1,14 +1,35 @@ +.PHONY: all +.PHONY: clean + +TARGET=clock + +########################################################### + ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif -TARGET = clock +########################################################### + +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif CC = $(CROSS_COMPILE)gcc -CFLAGS = -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve -LDFLAGS = -lSDL -lSDL_image +LIBS = -lSDL -lSDL_image + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 +CFLAGS += $(LIBS) all: - $(CC) main.c -o $(TARGET) $(CFLAGS) $(LDFLAGS) + $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) + clean: - rm -f $(TARGET) \ No newline at end of file + rm -f $(TARGET) diff --git a/src/common/common.c b/src/common/common.c index cda5391..05dca15 100644 --- a/src/common/common.c +++ b/src/common/common.c @@ -522,6 +522,7 @@ int GFX_blitHint(SDL_Surface* surface, char* htxt, int x, int y) { SDL_Surface* hint_text = TTF_RenderUTF8_Blended(font_m, htxt, white); SDL_BlitSurface(hint_text, NULL, surface, &(SDL_Rect){x,y}); SDL_FreeSurface(hint_text); + return hint_text->w; } int GFX_blitPill(SDL_Surface* surface, char* btxt, char* htxt, int x, int y) { SDL_Surface* button_text = TTF_RenderUTF8_Blended(font_s, btxt, bronze); diff --git a/src/confirm/main.c b/src/confirm/confirm.c similarity index 100% rename from src/confirm/main.c rename to src/confirm/confirm.c diff --git a/src/confirm/makefile b/src/confirm/makefile index e66b9e5..e7d89fe 100644 --- a/src/confirm/makefile +++ b/src/confirm/makefile @@ -1,14 +1,33 @@ +.PHONY: all +.PHONY: clean + +TARGET=confirm + +########################################################### + ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif -TARGET = confirm +########################################################### + +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif CC = $(CROSS_COMPILE)gcc -CFLAGS = -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve -LDFLAGS = + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 all: - $(CC) main.c -o $(TARGET) $(CFLAGS) $(LDFLAGS) + $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) + clean: - rm -f $(TARGET) \ No newline at end of file + rm -f $(TARGET) diff --git a/src/keyboard/makefile b/src/keyboard/makefile index 74feb79..5706d89 100644 --- a/src/keyboard/makefile +++ b/src/keyboard/makefile @@ -1,16 +1,35 @@ +.PHONY: all +.PHONY: clean + +TARGET=keyboard + +########################################################### + ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif -TARGET = keyboard +########################################################### + +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif CC = $(CROSS_COMPILE)gcc -CFLAGS = -Os -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -CFLAGS += -Wall -ffunction-sections -fdata-sections -fmerge-all-constants -fno-stack-protector -fno-ident -fomit-frame-pointer -CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops -fno-math-errno -ffast-math -LDFLAGS = -lSDL -lSDL_image -lSDL_ttf -Wl,--gc-sections -s +LIBS = -lSDL -lSDL_image -lSDL_ttf + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 +CFLAGS += $(LIBS) all: - $(CC) keyboard.c -o $(TARGET) $(CFLAGS) $(LDFLAGS) + $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) + clean: rm -f $(TARGET) diff --git a/src/keymon/makefile b/src/keymon/makefile index 471eb04..5dccef6 100755 --- a/src/keymon/makefile +++ b/src/keymon/makefile @@ -1,11 +1,35 @@ +.PHONY: all +.PHONY: clean + +TARGET=keymon + +########################################################### + ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif +########################################################### + +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif + CC = $(CROSS_COMPILE)gcc -FLAGS = -Os -lmsettings -lpthread -lrt -ldl -Wl,--gc-sections -s +LIBS = -lmsettings -lpthread -lrt -ldl + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 +CFLAGS += $(LIBS) all: - $(CC) keymon.c -o keymon $(FLAGS) + $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) + clean: - rm -rf keymon \ No newline at end of file + rm -f $(TARGET) diff --git a/src/libmmenu/makefile b/src/libmmenu/makefile index d76e8be..69d5be8 100644 --- a/src/libmmenu/makefile +++ b/src/libmmenu/makefile @@ -1,4 +1,4 @@ -.PHONY: build +.PHONY: all .PHONY: clean TARGET=mmenu @@ -20,32 +20,35 @@ endif ########################################################### -CC = $(CROSS_COMPILE)gcc - -SYSROOT := $(shell $(CC) --print-sysroot) - -INCLUDEDIR = $(SYSROOT)/usr/include -CFLAGS = -I$(INCLUDEDIR) -I. -I../common -DPLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z) -std=gnu99 -LDFLAGS = -s -lSDL -lSDL_image -lSDL_ttf -lz -lm -Wl,--no-as-needed -ldl -lrt - -CFLAGS += -ggdb3 -Og - -ifeq (trimui,$(PLATFORM)) -LDFLAGS += -ltinyalsa +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif endif -ifeq (rs90,$(PLATFORM)) -LDFLAGS += -lasound -endif - -OPTM=-Ofast -build: - $(CC) -c -Werror -fpic $(TARGET).c ../common/common.c $(CFLAGS) $(LDFLAGS) $(OPTM) - $(CC) -shared -o lib$(TARGET).so $(TARGET).o common.o +CC = $(CROSS_COMPILE)gcc +SYSROOT := $(shell $(CC) --print-sysroot) +INCLUDEDIR = $(SYSROOT)/usr/include +LIBS = -lSDL -lSDL_image -lSDL_ttf -lz -lm -ldl -lrt + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables +CFLAGS += -I$(INCLUDEDIR) -I. -I../common -DPLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z) -std=gnu99 +CFLAGS += -Wl,--no-as-needed +LDFLAGS = $(CFLAGS) $(LIBS) + +all: + $(CC) -c -fpic $(TARGET).c ../common/common.c $(CFLAGS) + $(CC) -shared -o lib$(TARGET).so $(TARGET).o common.o $(LDFLAGS) cp $(TARGET).h $(PREFIX)/include cp lib$(TARGET).so $(PREFIX)/lib + clean: - rm -f *.o + rm -f $(TARGET).o common.o rm -f lib$(TARGET).so rm -f $(PREFIX)/include/$(TARGET).h - rm -f $(PREFIX)/lib/lib$(TARGET).so \ No newline at end of file + rm -f $(PREFIX)/lib/lib$(TARGET).so diff --git a/src/libmsettings/makefile b/src/libmsettings/makefile index 34fa670..cc7b408 100644 --- a/src/libmsettings/makefile +++ b/src/libmsettings/makefile @@ -1,32 +1,54 @@ +.PHONY: all +.PHONY: clean + +TARGET=msettings + +########################################################### + +ifeq (,$(PLATFORM)) +PLATFORM=$(UNION_PLATFORM) +endif +ifeq (,$(PLATFORM)) +$(error please specify PLATFORM, eg. make PLATFORM=trimui) +endif ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif ifeq (,$(PREFIX)) -$(error missing PREFIX for this toolchain) +$(error missing PREFIX for installation in toolchain) endif -TARGET=msettings +########################################################### -.PHONY: build -.PHONY: clean +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif CC = $(CROSS_COMPILE)gcc - -SYSROOT := $(shell $(CC) --print-sysroot) - +SYSROOT := $(shell $(CC) --print-sysroot) INCLUDEDIR = $(SYSROOT)/usr/include -CFLAGS = -I$(INCLUDEDIR) -LDFLAGS = -lcam_os_wrapper -lmi_sys -lmi_ao -ldl -lrt -s -lm +LIBS = -lcam_os_wrapper -lmi_sys -lmi_ao -lm -ldl -lrt + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables +CFLAGS += -I$(INCLUDEDIR) -DPLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z) -std=gnu99 +CFLAGS += -Wl,--no-as-needed +LDFLAGS = $(CFLAGS) $(LIBS) -OPTM=-Ofast +all: + $(CC) -c -fpic $(TARGET).c $(CFLAGS) + $(CC) -shared -o lib$(TARGET).so $(TARGET).o $(LDFLAGS) + cp $(TARGET).h $(PREFIX)/include + cp lib$(TARGET).so $(PREFIX)/lib -build: - $(CC) -c -Werror -fpic "$(TARGET).c" -Wl,--no-as-needed $(LDFLAGS) - $(CC) -shared -o "lib$(TARGET).so" "$(TARGET).o" $(LDFLAGS) - cp "$(TARGET).h" "$(PREFIX)/include" - cp "lib$(TARGET).so" "$(PREFIX)/lib" clean: - rm -f *.o - rm -f "lib$(TARGET).so" + rm -f $(TARGET).o + rm -f lib$(TARGET).so rm -f $(PREFIX)/include/$(TARGET).h - rm -f $(PREFIX)/lib/lib$(TARGET).so \ No newline at end of file + rm -f $(PREFIX)/lib/lib$(TARGET).so diff --git a/src/lumon/makefile b/src/lumon/makefile index f76983d..4af3621 100644 --- a/src/lumon/makefile +++ b/src/lumon/makefile @@ -1,14 +1,35 @@ +.PHONY: all +.PHONY: clean + +TARGET=lumon + +########################################################### + ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif -TARGET = lumon +########################################################### + +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif CC = $(CROSS_COMPILE)gcc -CFLAGS = -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve -LDFLAGS = -Os -lmi_sys -lmi_disp +LIBS = -lmi_sys -lmi_disp + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 +CFLAGS += $(LIBS) all: - $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) $(LDFLAGS) + $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) + clean: - rm -f $(TARGET) \ No newline at end of file + rm -f $(TARGET) diff --git a/src/miniui/makefile b/src/miniui/makefile index 0802b02..2935b29 100644 --- a/src/miniui/makefile +++ b/src/miniui/makefile @@ -1,12 +1,13 @@ -.PHONY: build +.PHONY: all .PHONY: clean - + +TARGET=MiniUI + ########################################################### ifeq (,$(PLATFORM)) PLATFORM=$(UNION_PLATFORM) endif - ifeq (,$(PLATFORM)) $(error please specify PLATFORM, eg. make PLATFORM=trimui) endif @@ -16,14 +17,28 @@ endif ########################################################### +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif + CC = $(CROSS_COMPILE)gcc SYSROOT := $(shell $(CC) --print-sysroot) INCLUDEDIR = $(SYSROOT)/usr/include -CFLAGS = -I$(INCLUDEDIR) -I. -I../common -DPLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z) -std=gnu99 -LDFLAGS = -s -lSDL -lSDL_image -lSDL_ttf -lmsettings -lrt -lz -lm -OPTM=-O3 +LIBS = -lSDL -lSDL_image -lSDL_ttf -lmsettings -lz -lm -ldl -lrt + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables +CFLAGS += -I$(INCLUDEDIR) -I. -I../common -DPLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z) -std=gnu99 +CFLAGS += $(LIBS) -rdynamic + +all: + $(CC) -o $(TARGET) main.c ../common/common.c $(CFLAGS) -build: - $(CC) -o MiniUI main.c ../common/common.c $(CFLAGS) $(LDFLAGS) $(OPTM) -ldl -rdynamic clean: - rm -f MiniUI \ No newline at end of file + rm -f $(TARGET) diff --git a/src/oss/makefile b/src/oss/makefile index e8c46cd..458e069 100644 --- a/src/oss/makefile +++ b/src/oss/makefile @@ -1,16 +1,33 @@ +.PHONY: all +.PHONY: clean + +TARGET=oss + +########################################################### + ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif -TARGET = oss +########################################################### + +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif CC = $(CROSS_COMPILE)gcc -CFLAGS = -Os -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -CFLAGS += -Wall -ffunction-sections -fdata-sections -fmerge-all-constants -fno-stack-protector -fno-ident -fomit-frame-pointer -CFLAGS += -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops -fno-math-errno -ffast-math -LDFLAGS = -Wl,--gc-sections -s + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 all: - $(CC) oss.c -o $(TARGET) $(CFLAGS) $(LDFLAGS) + $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) + clean: rm -f $(TARGET) diff --git a/src/progressui/makefile b/src/progressui/makefile index 4338671..33635bb 100644 --- a/src/progressui/makefile +++ b/src/progressui/makefile @@ -1,12 +1,13 @@ -.PHONY: build +.PHONY: all .PHONY: clean - + +TARGET=progressui + ########################################################### ifeq (,$(PLATFORM)) PLATFORM=$(UNION_PLATFORM) endif - ifeq (,$(PLATFORM)) $(error please specify PLATFORM, eg. make PLATFORM=trimui) endif @@ -16,14 +17,28 @@ endif ########################################################### +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif + CC = $(CROSS_COMPILE)gcc SYSROOT := $(shell $(CC) --print-sysroot) INCLUDEDIR = $(SYSROOT)/usr/include -CFLAGS = -I$(INCLUDEDIR) -I. -I../common -DPLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z) -std=gnu99 -LDFLAGS = -s -lSDL -lSDL_image -lSDL_ttf -lmsettings -lpthread -lrt -lz -lm -OPTM=-O3 +LIBS = -lSDL -lSDL_image -lSDL_ttf -lmsettings -lz -lm -ldl -lrt -lpthread + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables +CFLAGS += -I$(INCLUDEDIR) -I. -I../common -DPLATFORM_$(shell echo $(PLATFORM) | tr a-z A-Z) -std=gnu99 +CFLAGS += $(LIBS) -rdynamic + +all: + $(CC) -o $(TARGET) main.c ../common/common.c $(CFLAGS) -build: - $(CC) -o progressui main.c ../common/common.c $(CFLAGS) $(LDFLAGS) $(OPTM) -ldl -rdynamic clean: - rm -f progressui \ No newline at end of file + rm -f $(TARGET) diff --git a/src/say/makefile b/src/say/makefile index 6eb9615..4467fe2 100644 --- a/src/say/makefile +++ b/src/say/makefile @@ -1,14 +1,35 @@ +.PHONY: all +.PHONY: clean + +TARGET=say + +########################################################### + ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif -TARGET = say +########################################################### + +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif CC = $(CROSS_COMPILE)gcc -CFLAGS = -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve -LDFLAGS = -lSDL -lSDL_image -lSDL_ttf +LIBS = -lSDL -lSDL_image -lSDL_ttf + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 +CFLAGS += $(LIBS) all: - $(CC) main.c -o $(TARGET) $(CFLAGS) $(LDFLAGS) + $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) + clean: - rm -f $(TARGET) \ No newline at end of file + rm -f $(TARGET) diff --git a/src/say/main.c b/src/say/say.c similarity index 100% rename from src/say/main.c rename to src/say/say.c diff --git a/src/show/makefile b/src/show/makefile index 72b4a35..03c59ce 100644 --- a/src/show/makefile +++ b/src/show/makefile @@ -1,14 +1,35 @@ +.PHONY: all +.PHONY: clean + +TARGET=show + +########################################################### + ifeq (,$(CROSS_COMPILE)) $(error missing CROSS_COMPILE for this toolchain) endif -TARGET = show +########################################################### + +ifeq ($(DEBUG), 1) + CFLAGS = -ggdb3 -Og -DDEBUG +else + CFLAGS = -Os -DNDEBUG + ifneq ($(PROFILE), 1) + CFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections -s + endif +endif CC = $(CROSS_COMPILE)gcc -CFLAGS = -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -march=armv7ve -LDFLAGS = -lSDL -lSDL_image +LIBS = -lSDL -lSDL_image + +CFLAGS += -Wall -marm -march=armv7ve+simd -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard +CFLAGS += -flto -fipa-pta -fipa-ra -ftree-vectorize -ffast-math -funsafe-math-optimizations +CFLAGS += -fno-math-errno -fno-unwind-tables -fno-asynchronous-unwind-tables -std=gnu99 +CFLAGS += $(LIBS) all: - $(CC) main.c -o $(TARGET) $(CFLAGS) $(LDFLAGS) + $(CC) $(TARGET).c -o $(TARGET) $(CFLAGS) + clean: - rm -f $(TARGET) \ No newline at end of file + rm -f $(TARGET) diff --git a/src/show/main.c b/src/show/show.c similarity index 100% rename from src/show/main.c rename to src/show/show.c