Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 108 lines (92 sloc) 3.633 kb
a134482 Added 'make rescue' target to Makefile, to allow automatically retrievin...
nddrylliog authored
1 .PHONY: all clean mrproper prepare_bootstrap bootstrap install rescue backup
87c4e3a @nddrylliog nagaqueen now works again with greg =) Une sombre histoire d'allocation ...
nddrylliog authored
2 PARSER_GEN=greg
5c44c50 @nddrylliog make prepare_bootstrap boostrap; works now! party o/
nddrylliog authored
3 NQ_PATH=source/rock/frontend/NagaQueen.c
4e58358 Added build date & time info in the output of 'rock -V', much more usefu...
Amos Wenger authored
4 DATE=$(shell date +%Y-%m-%d)
5 TIME=$(shell date +%H:%M)
b106edf @mickael9 Add OOC_WARN_FLAGS to Makefile
mickael9 authored
6 OOC_WARN_FLAGS?=+-w
6b184fc @fredreichbier Escape arguments in ProcessWin32; pass -rdynamic only on linux
fredreichbier authored
7 OOC_OWN_FLAGS=-sourcepath=source -v +-O0 -g -ignoredefine=ROCK_BUILD_ ${OOC_WARN_FLAGS}
04e6ed3 @nddrylliog Hmmm better be conditional
nddrylliog authored
8
c032faf @fredreichbier Added `GCC` variable to the Makefile to modify the compiler that's used ...
fredreichbier authored
9 CC?=gcc
ad024cf @nddrylliog Manpage update, INSTALL instructions update
nddrylliog authored
10 PREFIX?=/usr
11 MAN_INSTALL_PATH?=/usr/local/man/man1
12 BIN_INSTALL_PATH?=${PREFIX}/bin
13
04e6ed3 @nddrylliog Hmmm better be conditional
nddrylliog authored
14 ifdef WINDIR
15 OOC_OWN_FLAGS+=+-DROCK_BUILD_DATE=\\\"${DATE}\\\" +-DROCK_BUILD_TIME=\\\"${TIME}\\\"
16 else
6b184fc @fredreichbier Escape arguments in ProcessWin32; pass -rdynamic only on linux
fredreichbier authored
17 OOC_OWN_FLAGS+=+-DROCK_BUILD_DATE=\"${DATE}\" +-DROCK_BUILD_TIME=\"${TIME}\" +-rdynamic
04e6ed3 @nddrylliog Hmmm better be conditional
nddrylliog authored
18 endif
19
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more si...
nddrylliog authored
20 OOC?=rock
e71088a @nddrylliog Various fixes
nddrylliog authored
21 OOC_CMD=${OOC} ${OOC_OWN_FLAGS} ${OOC_FLAGS}
0c92e69 @nddrylliog Improved greatly the port of SourceReader, Token toString(), the Tokeniz...
nddrylliog authored
22
1c8ebbe @fredreichbier Made `Makefile` a bit friendlier: Display a message to the first-time gi...
fredreichbier authored
23 IS_BOOTSTRAP=$(wildcard build/Makefile)
24
ad024cf @nddrylliog Manpage update, INSTALL instructions update
nddrylliog authored
25 all: bootstrap
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more si...
nddrylliog authored
26
27 # Regenerate NagaQueen.c from the greg grammar
28 # you need ../nagaqueen and greg to be in your path
29 #
30 # http://github.com/nddrylliog/nagaqueen
31 # http://github.com/nddrylliog/greg
32 grammar:
cac060b @nddrylliog Adjusted the Makefile to pre-compile NagaQueen.o, makes slave mode much ...
nddrylliog authored
33 ${PARSER_GEN} ../nagaqueen/grammar/nagaqueen.leg > ${NQ_PATH}
d15223e @fredreichbier Makefile: Use `$(MAKE)` instead of `make`, should fix make problems on m...
fredreichbier authored
34 $(MAKE) .libs/NagaQueen.o
cac060b @nddrylliog Adjusted the Makefile to pre-compile NagaQueen.o, makes slave mode much ...
nddrylliog authored
35
fb81834 @nddrylliog Fixes to 'make grammar'
nddrylliog authored
36 .libs/NagaQueen.o: source/rock/frontend/NagaQueen.c
cac060b @nddrylliog Adjusted the Makefile to pre-compile NagaQueen.o, makes slave mode much ...
nddrylliog authored
37 mkdir -p .libs
c032faf @fredreichbier Added `GCC` variable to the Makefile to modify the compiler that's used ...
fredreichbier authored
38 ${CC} -std=c99 ${NQ_PATH} -O3 -fomit-frame-pointer -D__OOC_USE_GC__ -w -c -o .libs/NagaQueen.o
fdc63ae changed Makefile back to performance settings for Nagaqueen
rofl0r authored
39 # gcc -std=c99 ${NQ_PATH} -O0 -g -D__OOC_USE_GC__ -w -c -o .libs/NagaQueen.o
9b16ce9 @nddrylliog Added many types of nodes, now rock trivially produces .c/.h files based...
nddrylliog authored
40
5c44c50 @nddrylliog make prepare_bootstrap boostrap; works now! party o/
nddrylliog authored
41 # Prepares the build/ directory, used for bootstrapping
42 # The build/ directory contains all the C sources needed to build rock
43 # and a nice Makefile, too
44 prepare_bootstrap:
45 @echo "Preparing boostrap (in build/ directory)"
ec6d082 @nddrylliog Fixed Makefile for bootstrapping, changed CommandLine to 0.9.0
nddrylliog authored
46 rm -rf build/
e78d46e @nddrylliog Docs o/
nddrylliog authored
47 ${OOC} -driver=make -sourcepath=source -outpath=c-source rock/rock -o=../bin/c_rock c-source/${NQ_PATH} -v -g +-w
e83c4fe @nikobordx Added FreeBSD.
nikobordx authored
48 ifeq ($(shell uname -s), FreeBSD)
49 sed s/-w.*/-w\ -DROCK_BUILD_DATE=\\\"\\\\\"bootstrapped\\\\\"\\\"\ -DROCK_BUILD_TIME=\\\"\\\\\"\\\\\"\\\"/ build/Makefile > build/Makefile.tmp
50 rm build/Makefile
51 mv build/Makefile.tmp build/Makefile
52 else
3d49553 @nddrylliog INT_MIN fixes, Win32 fixes for SdkLocator and Module, MakeDriver improve...
nddrylliog authored
53 sed s/-w.*/-w\ -DROCK_BUILD_DATE=\\\"\\\\\"bootstrapped\\\\\"\\\"\ -DROCK_BUILD_TIME=\\\"\\\\\"\\\\\"\\\"/ -i build/Makefile
e83c4fe @nikobordx Added FreeBSD.
nikobordx authored
54 endif
5c44c50 @nddrylliog make prepare_bootstrap boostrap; works now! party o/
nddrylliog authored
55 cp ${NQ_PATH} build/c-source/${NQ_PATH}
56 @echo "Done!"
57
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more si...
nddrylliog authored
58 # For c-source based rock releases, 'make bootstrap' will compile a version
59 # of rock from the C sources in build/, then use that version to re-compile itself
60 bootstrap:
1c8ebbe @fredreichbier Made `Makefile` a bit friendlier: Display a message to the first-time gi...
fredreichbier authored
61 ifneq ($(IS_BOOTSTRAP),)
77f823e @duckinator I failed. Makefiles require tabs, not spaces
duckinator authored
62 @echo "Creating bin/ in case it does not exist."
63 mkdir -p bin/
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more si...
nddrylliog authored
64 @echo "Compiling from C source"
d15223e @fredreichbier Makefile: Use `$(MAKE)` instead of `make`, should fix make problems on m...
fredreichbier authored
65 cd build/ && ROCK_DIST=.. $(MAKE)
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more si...
nddrylliog authored
66 @echo "Now re-compiling ourself"
d15223e @fredreichbier Makefile: Use `$(MAKE)` instead of `make`, should fix make problems on m...
fredreichbier authored
67 OOC=bin/c_rock ROCK_DIST=. $(MAKE) self
5c44c50 @nddrylliog make prepare_bootstrap boostrap; works now! party o/
nddrylliog authored
68 @echo "Congrats! you have a boostrapped version of rock in bin/rock now. Have fun!"
1c8ebbe @fredreichbier Made `Makefile` a bit friendlier: Display a message to the first-time gi...
fredreichbier authored
69 else
70 @cat BOOTSTRAP
71 @exit 1
72 endif
ad024cf @nddrylliog Manpage update, INSTALL instructions update
nddrylliog authored
73 # Copy the manpage and create a symlink to the binary
74 install:
0aef726 @tsion Fixing the `install` make target. Using rm -f to ignore silently when ro...
tsion authored
75 if [ -e ${BIN_INSTALL_PATH}/rock ]; then echo "${BIN_INSTALL_PATH}/rock already exists, overwriting."; rm -f ${BIN_INSTALL_PATH}/rock ${BIN_INSTALL_PATH}/rock.exe; fi
ad024cf @nddrylliog Manpage update, INSTALL instructions update
nddrylliog authored
76 ln -s $(shell pwd)/bin/rock* ${BIN_INSTALL_PATH}/
8d93fe3 @nddrylliog Use install instead of copy, make dirs if they're not there, other sorts...
nddrylliog authored
77 install -d ${MAN_INSTALL_PATH}
78 install docs/rock.1 ${MAN_INSTALL_PATH}/
e0380be @nddrylliog Added -ignoredefine option to make libcaching not care about some -D
nddrylliog authored
79
ad024cf @nddrylliog Manpage update, INSTALL instructions update
nddrylliog authored
80 # Regenerate the man page from docs/rock.1.txt You need ascidoc for that
81 man:
82 cd docs/ && a2x -f manpage rock.1.txt
83
9acab22 @nddrylliog Cleanups, improvements to slave mode / lib-caching, etc.
nddrylliog authored
84 # Compile rock with itself
cac060b @nddrylliog Adjusted the Makefile to pre-compile NagaQueen.o, makes slave mode much ...
nddrylliog authored
85 self: .libs/NagaQueen.o
9886f25 @nddrylliog Get rid of preposterous dot file and adjust the Makefile instead.
nddrylliog authored
86 mkdir -p bin/
cac060b @nddrylliog Adjusted the Makefile to pre-compile NagaQueen.o, makes slave mode much ...
nddrylliog authored
87 ${OOC_CMD} rock/rock -o=bin/rock .libs/NagaQueen.o
46bed08 @nddrylliog Fixes. Debug code. A little mess, but more good than harm. Will clean up...
nddrylliog authored
88
a134482 Added 'make rescue' target to Makefile, to allow automatically retrievin...
nddrylliog authored
89 # Save your rock binary under bin/safe_rock
184bb0e @nddrylliog 'make backup' to create a backup copy of the rock executable. 'make safe...
nddrylliog authored
90 backup:
91 cp bin/rock bin/safe_rock
92
a134482 Added 'make rescue' target to Makefile, to allow automatically retrievin...
nddrylliog authored
93 # Attempt to grab a rock bootstrap from Alpaca and recompile
94 rescue:
95 git pull
96 rm -rf build/
97 wget http://commondatastorage.googleapis.com/rock-linux/rock-bootstrap-only.tar.bz2 -O - | tar xjvmp
d15223e @fredreichbier Makefile: Use `$(MAKE)` instead of `make`, should fix make problems on m...
fredreichbier authored
98 $(MAKE) clean bootstrap
a134482 Added 'make rescue' target to Makefile, to allow automatically retrievin...
nddrylliog authored
99
100 # Compile rock with the backup'd version of itself
184bb0e @nddrylliog 'make backup' to create a backup copy of the rock executable. 'make safe...
nddrylliog authored
101 safe:
d15223e @fredreichbier Makefile: Use `$(MAKE)` instead of `make`, should fix make problems on m...
fredreichbier authored
102 OOC=bin/safe_rock $(MAKE) self
184bb0e @nddrylliog 'make backup' to create a backup copy of the rock executable. 'make safe...
nddrylliog authored
103
a134482 Added 'make rescue' target to Makefile, to allow automatically retrievin...
nddrylliog authored
104 # Clean all temporary files that may make a build fail
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more si...
nddrylliog authored
105 clean:
9acab22 @nddrylliog Cleanups, improvements to slave mode / lib-caching, etc.
nddrylliog authored
106 rm -rf *_tmp/ .libs/
410f00f fixed make clean in makefile for make bootstrap, added a workaround for ...
rofl0r authored
107 rm -rf `find build/ -name '*.o'`
Something went wrong with that request. Please try again.