-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
97 additions
and
79 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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Cross-compilation stubs for GNU make | ||
# w: Windows | ||
# l: Linux | ||
# m: Mac | ||
help: | ||
@echo "valid values for TARGET: w, l, m" | ||
|
||
ifndef TARGET | ||
$(warning TARGET not defined, assuming Linux) | ||
TARGET := l | ||
endif | ||
|
||
ARCH := x86_64 | ||
|
||
ifeq ($(TARGET),w) | ||
MINGW := x86_64-w64-mingw32 | ||
CC := $(MINGW)-gcc | ||
CPP := $(MINGW)-c++ | ||
AR := $(MINGW)-ar | ||
|
||
LIBWPD_A := /usr/$(ARCH)-w64-mingw32/lib/libwpd.a | ||
LIBLUA_A := /usr/$(ARCH)-w64-mingw32/lib/liblua.a | ||
LIBUI_DLL := /usr/$(ARCH)-w64-mingw32/lib/libui_win64.dll | ||
LIBUI_A := /usr/$(ARCH)-w64-mingw32/lib/libui.a | ||
|
||
WIN_LINK_ESSENTIALS += -luser32 -lkernel32 -lgdi32 -lcomctl32 -luxtheme -lmsimg32 -lcomdlg32 -ld2d1 -ldwrite -lole32 -loleaut32 -loleacc -lssp -lurlmon -luuid -lws2_32 | ||
|
||
%.res: %.rc | ||
$(MINGW)-windres $< -O coff -o $@ | ||
endif | ||
|
||
ifeq ($(TARGET),l) | ||
# Create appimages | ||
# TODO: Link to linuxdeploy and appimagetool | ||
define create_appimage | ||
linuxdeploy --appdir=AppDir --executable=$1.out -d assets/$1.desktop -i assets/$1.png | ||
appimagetool AppDir | ||
endef | ||
|
||
endif | ||
|
||
# Convert object list to $(TARGET).o | ||
# eg: x.o a.o -> x.w.o a.w.o if $(TARGET) is w | ||
define convert_target | ||
$(patsubst %.o,%.$(TARGET).o,$1) | ||
endef | ||
|
||
%.$(TARGET).o: %.c | ||
$(CC) -MMD -c $< $(CFLAGS) -o $@ | ||
|
||
%.$(TARGET).o: %.cpp | ||
$(CC) -MMD -c $< $(CFLAGS) -o $@ | ||
|
||
%.$(TARGET).o: %.S | ||
$(CC) -c $< $(CFLAGS) -o $@ | ||
|
||
%.$(TARGET).o: %.m | ||
$(CC) -c $< $(CFLAGS) -o $@ |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ide/demo.h: ide/test.lua | ||
cd ide && xxd -i test.lua > demo.h | ||
ide/test.c: ide/demo.h | ||
|
||
TESTER_FILES := $(addprefix test/,drawtests.w.o images.w.o main.w.o menus.w.o page1.w.o page2.w.o page3.w.o page4.w.o page5.w.o page6.w.o page7.w.o page7a.w.o page7b.w.o page7c.w.o page11.w.o page12.w.o page13.w.o page14.w.o page15.w.o page16.w.o page17.w.o spaced.w.o) | ||
|
||
tester.exe: $(TESTER_FILES) test/resources.res libui_win64.a | ||
$(CC) -static $(TESTER_FILES) libui_win64.a test/resources.res $(LIBS) -o tester.exe | ||
|
||
UNIT_FILES := $(patsubst %.c,%.$(TARGET).o,$(wildcard test/unit/*.c)) subprojects/cmocka-1.1.5/src/cmocka.w.o | ||
unit.exe: $(UNIT_FILES) test/unit/resources.res libui_win64.a | ||
$(CC) -static $(UNIT_FILES) libui_win64.a test/unit/resources.res $(LIBS) -o unit.exe |