Skip to content

Commit

Permalink
Makefile now uses lazbuild
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit e60ffbc
Author: Merlijn Wajer <[email protected]>
Date:   Sat Jul 16 21:18:25 2016 +0200

    Pass 7z the right Simba executable

commit 6918df4
Author: Merlijn Wajer <[email protected]>
Date:   Sat Jul 16 21:11:55 2016 +0200

    Attempt to fix the 7z generation

commit 9329cba
Author: Merlijn Wajer <[email protected]>
Date:   Sat Jul 16 21:05:41 2016 +0200

    Don't build everything.

commit 13e584d
Author: Merlijn Wajer <[email protected]>
Date:   Sat Jul 16 21:01:42 2016 +0200

    Attempt to fix buildbot

commit 8942fde
Author: John Peel <[email protected]>
Date:   Sat Jul 16 05:58:56 2016 -0400

    Pass compiler path to lazbuild

commit 56f200e
Author: John Peel <[email protected]>
Date:   Sat Jul 16 05:54:12 2016 -0400

    Pass lazarusdir to lazbuild

commit 56276ad
Author: John Peel <[email protected]>
Date:   Sat Jul 16 05:50:19 2016 -0400

    Updated Makefile to use lazbuild
  • Loading branch information
MerlijnWajer committed Jul 16, 2016
1 parent 376d3ac commit ce36dc2
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions Projects/Simba/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,22 @@ else
our_target := unknown
endif

CC := $(fpcpath)
CC := lazbuild
build := $(CC)

# -Xd doesn't seem to cause problems when not cross-compiling, and is needed when cross-compiling, so I'm leaving it here
# -Xg = External debug file (Simba.dbg)
common_flags := -Xd -MObjFPC -Scgi -O2 -OoREGVAR -gl -vewnhi -l -Fu. -dM_MEMORY_DEBUG -dLCL -Xg
units := -Fu../../Units/MMLCore/ -Fu../../Units/MMLAddon/ -Fu../../Units/MMLAddon/PSInc/ -Fu../../Units/PascalScript/ -Fu../../Units/Misc/ -Fu../../Units/Linux/ -Fu../../Units/Synapse/ -Fu../../Units/lape -Fu../../Units/Misc/DCPCrypt -Fu../../Units/Misc/DCPCrypt/Ciphers -Fu../../Units/Misc/DCPCrypt/Hashes -Fu../../Units/lape/extensions/ffi -Fu../../Units/lape -Fu../../Units/MMLAddon/LPInc/Classes -Fu../../Units/MMLAddon/LPInc/Classes/MML -Fu../../Units/MMLAddon/LPInc/Classes/miniLCL -Fi../../Units/lape -Fu../ScriptManager -Fu../FormDesigner -Fu../FormDesigner/CodeGen -dLape_CDECL

binary := Simba.$(platform)
# windows wants executables to end in .exe
ifeq ($(widgetset),win32)
binary_extension := .exe
endif
lclplatpath := $(lazaruspath)/lcl/units/$(platform)/
lazarusunits := -Fu$(lazaruspath)/components/synedit/units/$(platform)/ -Fu$(lazaruspath)ideintf/units/$(platform)/ -Fu$(lclplatpath) -Fu$(lclplatpath)$(widgetset)/ -Fu$(lazaruspath)/packager/units/$(platform)/ -Fu$(lazaruspath)/components/mouseandkeyinput/ -Fu$(lazaruspath)/components/lazutils/ -Fu$(lazaruspath)/components/synedit

default: build

build: $(our_target)

rebuild: clean build

recursive_build: $(binary)$(binary_extension)
recursive_build: $(binary)-debug$(binary_extension) $(binary)$(binary_extension)

unknown:
@echo Unable to auto-detect the OS and architecture you wish to build for, please specify target manually.
Expand All @@ -95,9 +88,11 @@ clean:
# now clean all the unit directories (I love Bash...)
rm -f ../../Units/*/*.a ../../Units/*/*.o ../../Units/*/*.ppu ../../Units/*/*.rst

$(binary)-debug$(binary_extension):
$(CC) --os=$(os) --cpu=$(cpu) --ws=$(widgetset) --lazarusdir="$(lazaruspath)" --compiler="$(fpcpath)" --bm=Debug -B -d Simba.lpi
$(binary)$(binary_extension):
$(CC) $(common_flags) $(platform_flags) -dLCL$(widgetset) $(units) $(lazarusunits) -o$(binary)$(binary_extension) Simba.lpr
strip $(binary)$(binary_extension)
$(CC) --os=$(os) --cpu=$(cpu) --ws=$(widgetset) --lazarusdir="$(lazaruspath)" --compiler="$(fpcpath)" --bm=Release -B -d Simba.lpi

ifdef distrib
# you may not want this down below here, just don't define distrib (it makes a distribution .7z file in the top-level directory)

Expand All @@ -108,7 +103,7 @@ ifdef distrib
#mv ../../Plugins ../../Plugins_bak
#mkdir -p ../../Plugins
#cp $(plugins_dir)/$(platform)/* ../../Plugins/
7z a ../../$(binary).7z $(binary)$(binary_extension) ../../Extensions/ ../../Fonts/ ../../Includes/ ../../Plugins/ ../../Scripts ../../Documentation
7z a ../../$(binary).7z ../../$(binary)$(binary_extension) ../../Extensions/ ../../Fonts/ ../../Includes/ ../../Plugins/ ../../Scripts ../../Documentation
# now undo everything we did above
#rm -rf ../../Plugins
#mv ../../Plugins_bak ../../Plugins
Expand All @@ -117,20 +112,18 @@ ifdef distrib
endif

i386-linux:
$(MAKE) recursive_build platform="i386-linux" widgetset="gtk2" platform_flags="-Tlinux -Pi386 -dUseCThreads -dStaticFFI"
$(MAKE) recursive_build platform="i386-linux" widgetset="gtk2" os="linux" cpu="i386"
mv Simba.dbg Simba.i386-linux.dbg

x86_64-linux:
$(MAKE) recursive_build platform="x86_64-linux" widgetset="gtk2" platform_flags="-Tlinux -Px86_64 -dUseCThreads -dStaticFFI"
$(MAKE) recursive_build platform="x86_64-linux" widgetset="gtk2" os="linux" cpu="x86_64"
mv Simba.dbg Simba.x86_64-linux.dbg

i386-win32:
$(MAKE) recursive_build platform="i386-win32" widgetset="win32" platform_flags="-Twin32 -Pi386 -Fl../../Units/lape/extensions/ffi/bin/win32 -dStaticFFI"
# Windows already names the .dbg properly...
$(MAKE) recursive_build platform="i386-win32" widgetset="win32" os="win32" cpu="i386"

x86_64-win64:
$(MAKE) recursive_build platform="x86_64-win64" widgetset="win32" platform_flags="-Twin64 -Px86_64 -Fl../../Units/lape/extensions/ffi/bin/win64 -dDynamicFFI"
# Windows already names the .dbg properly...
$(MAKE) recursive_build platform="x86_64-win64" widgetset="win32" os="win64" cpu="x86_64"

all: i386-linux x86_64-linux i386-win32 x86_64-win64

Expand All @@ -142,7 +135,7 @@ all-in-one-distrib: all
#mv ../../Plugins ../../Plugins_bak
#mkdir -p ../../Plugins
#cp $(plugins_dir)/all-in-one/* ../../Plugins/
7z a ../../Simba.all-in-one.7z Simba.i386-* Simba.x86_64-* ../../Extensions/ ../../Fonts/ ../../Includes/ ../../Plugins/ ../../Scripts ../../Documentation
7z a ../../Simba.all-in-one.7z ../../Simba.i386-* ../../Simba.x86_64-* ../../Extensions/ ../../Fonts/ ../../Includes/ ../../Plugins/ ../../Scripts ../../Documentation
# now undo everything we did above
#rm -rf ../../Plugins
#mv ../../Plugins_bak ../../Plugins
Expand Down

0 comments on commit ce36dc2

Please sign in to comment.