Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 123 lines (102 sloc) 4.158 kB
a56b5b7 @duckinator Split `make rescue` into 2 steps
duckinator authored
1 .PHONY: all clean mrproper prepare_bootstrap bootstrap install download-bootstrap rescue backup
87c4e3a @nddrylliog nagaqueen now works again with greg =) Une sombre histoire d'allocati…
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 us…
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
b2d457f @duckinator Use double-dash flags in Makefile. Fixes #402
duckinator 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
41fc1cf @nddrylliog Fix everything win32-related. Closes #356. Closes #357
nddrylliog authored
9 # used to be CC?=gcc, but that breaks on mingw where CC is set to 'cc' apparently
10 CC=gcc
ad024cf @nddrylliog Manpage update, INSTALL instructions update
nddrylliog authored
11 PREFIX?=/usr
12 MAN_INSTALL_PATH?=/usr/local/man/man1
13 BIN_INSTALL_PATH?=${PREFIX}/bin
14
04e6ed3 @nddrylliog Hmmm better be conditional
nddrylliog authored
15 ifdef WINDIR
16 OOC_OWN_FLAGS+=+-DROCK_BUILD_DATE=\\\"${DATE}\\\" +-DROCK_BUILD_TIME=\\\"${TIME}\\\"
17 else
6b184fc @fredreichbier Escape arguments in ProcessWin32; pass -rdynamic only on linux
fredreichbier authored
18 OOC_OWN_FLAGS+=+-DROCK_BUILD_DATE=\"${DATE}\" +-DROCK_BUILD_TIME=\"${TIME}\" +-rdynamic
04e6ed3 @nddrylliog Hmmm better be conditional
nddrylliog authored
19 endif
20
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more…
nddrylliog authored
21 OOC?=rock
e71088a @nddrylliog Various fixes
nddrylliog authored
22 OOC_CMD=${OOC} ${OOC_OWN_FLAGS} ${OOC_FLAGS}
0c92e69 @nddrylliog Improved greatly the port of SourceReader, Token toString(), the Toke…
nddrylliog authored
23
1c8ebbe @fredreichbier Made `Makefile` a bit friendlier: Display a message to the first-time…
fredreichbier authored
24 IS_BOOTSTRAP=$(wildcard build/Makefile)
25
ad024cf @nddrylliog Manpage update, INSTALL instructions update
nddrylliog authored
26 all: bootstrap
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more…
nddrylliog authored
27
28 # Regenerate NagaQueen.c from the greg grammar
29 # you need ../nagaqueen and greg to be in your path
30 #
31 # http://github.com/nddrylliog/nagaqueen
32 # http://github.com/nddrylliog/greg
33 grammar:
cac060b @nddrylliog Adjusted the Makefile to pre-compile NagaQueen.o, makes slave mode mu…
nddrylliog authored
34 ${PARSER_GEN} ../nagaqueen/grammar/nagaqueen.leg > ${NQ_PATH}
d15223e @fredreichbier Makefile: Use `$(MAKE)` instead of `make`, should fix make problems o…
fredreichbier authored
35 $(MAKE) .libs/NagaQueen.o
cac060b @nddrylliog Adjusted the Makefile to pre-compile NagaQueen.o, makes slave mode mu…
nddrylliog authored
36
fb81834 @nddrylliog Fixes to 'make grammar'
nddrylliog authored
37 .libs/NagaQueen.o: source/rock/frontend/NagaQueen.c
cac060b @nddrylliog Adjusted the Makefile to pre-compile NagaQueen.o, makes slave mode mu…
nddrylliog authored
38 mkdir -p .libs
c032faf @fredreichbier Added `GCC` variable to the Makefile to modify the compiler that's us…
fredreichbier authored
39 ${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
40 # 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 ba…
nddrylliog authored
41
5c44c50 @nddrylliog make prepare_bootstrap boostrap; works now! party o/
nddrylliog authored
42 # Prepares the build/ directory, used for bootstrapping
43 # The build/ directory contains all the C sources needed to build rock
44 # and a nice Makefile, too
45 prepare_bootstrap:
46 @echo "Preparing boostrap (in build/ directory)"
ec6d082 @nddrylliog Fixed Makefile for bootstrapping, changed CommandLine to 0.9.0
nddrylliog authored
47 rm -rf build/
e78d46e @nddrylliog Docs o/
nddrylliog authored
48 ${OOC} -driver=make -sourcepath=source -outpath=c-source rock/rock -o=../bin/c_rock c-source/${NQ_PATH} -v -g +-w
c37cec7 @duckinator Simplify the Makefile a bit.
duckinator authored
49
50 # Don't use `sed -i`. That breaks on FreeBSD, and likely other systems as well.
e83c4fe @nikobordx Added FreeBSD.
nikobordx authored
51 sed s/-w.*/-w\ -DROCK_BUILD_DATE=\\\"\\\\\"bootstrapped\\\\\"\\\"\ -DROCK_BUILD_TIME=\\\"\\\\\"\\\\\"\\\"/ build/Makefile > build/Makefile.tmp
52 rm build/Makefile
53 mv build/Makefile.tmp build/Makefile
c37cec7 @duckinator Simplify the Makefile a bit.
duckinator authored
54
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
88e534c @nddrylliog Less retarded makefile imported from -source
nddrylliog authored
58 boehmgc:
fde7b5f @duckinator Add `LIBGC_FORCE_COMPILE=true` flag.
duckinator authored
59 cd libs && $(MAKE) LIBGC_FORCE_COMPILE=${LIBGC_FORCE_COMPILE}
88e534c @nddrylliog Less retarded makefile imported from -source
nddrylliog authored
60
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more…
nddrylliog authored
61 # For c-source based rock releases, 'make bootstrap' will compile a version
62 # of rock from the C sources in build/, then use that version to re-compile itself
88e534c @nddrylliog Less retarded makefile imported from -source
nddrylliog authored
63 bootstrap: boehmgc
1c8ebbe @fredreichbier Made `Makefile` a bit friendlier: Display a message to the first-time…
fredreichbier authored
64 ifneq ($(IS_BOOTSTRAP),)
88e534c @nddrylliog Less retarded makefile imported from -source
nddrylliog authored
65 @echo "Creating bin/ in case it does not exist."
77f823e @duckinator I failed. Makefiles require tabs, not spaces
duckinator authored
66 mkdir -p bin/
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more…
nddrylliog authored
67 @echo "Compiling from C source"
d15223e @fredreichbier Makefile: Use `$(MAKE)` instead of `make`, should fix make problems o…
fredreichbier authored
68 cd build/ && ROCK_DIST=.. $(MAKE)
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more…
nddrylliog authored
69 @echo "Now re-compiling ourself"
d15223e @fredreichbier Makefile: Use `$(MAKE)` instead of `make`, should fix make problems o…
fredreichbier authored
70 OOC=bin/c_rock ROCK_DIST=. $(MAKE) self
5c44c50 @nddrylliog make prepare_bootstrap boostrap; works now! party o/
nddrylliog authored
71 @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…
fredreichbier authored
72 else
73 @cat BOOTSTRAP
74 @exit 1
75 endif
ad024cf @nddrylliog Manpage update, INSTALL instructions update
nddrylliog authored
76 # Copy the manpage and create a symlink to the binary
77 install:
0aef726 @tsion Fixing the `install` make target. Using rm -f to ignore silently when…
tsion authored
78 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
79 ln -s $(shell pwd)/bin/rock* ${BIN_INSTALL_PATH}/
8d93fe3 @nddrylliog Use install instead of copy, make dirs if they're not there, other so…
nddrylliog authored
80 install -d ${MAN_INSTALL_PATH}
81 install docs/rock.1 ${MAN_INSTALL_PATH}/
e0380be @nddrylliog Added -ignoredefine option to make libcaching not care about some -D
nddrylliog authored
82
ad024cf @nddrylliog Manpage update, INSTALL instructions update
nddrylliog authored
83 # Regenerate the man page from docs/rock.1.txt You need ascidoc for that
84 man:
85 cd docs/ && a2x -f manpage rock.1.txt
86
9acab22 @nddrylliog Cleanups, improvements to slave mode / lib-caching, etc.
nddrylliog authored
87 # Compile rock with itself
cac060b @nddrylliog Adjusted the Makefile to pre-compile NagaQueen.o, makes slave mode mu…
nddrylliog authored
88 self: .libs/NagaQueen.o
9886f25 @nddrylliog Get rid of preposterous dot file and adjust the Makefile instead.
nddrylliog authored
89 mkdir -p bin/
cac060b @nddrylliog Adjusted the Makefile to pre-compile NagaQueen.o, makes slave mode mu…
nddrylliog authored
90 ${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…
nddrylliog authored
91
a134482 Added 'make rescue' target to Makefile, to allow automatically retrie…
nddrylliog authored
92 # Save your rock binary under bin/safe_rock
184bb0e @nddrylliog 'make backup' to create a backup copy of the rock executable. 'make s…
nddrylliog authored
93 backup:
94 cp bin/rock bin/safe_rock
95
a56b5b7 @duckinator Split `make rescue` into 2 steps
duckinator authored
96 download-bootstrap:
a134482 Added 'make rescue' target to Makefile, to allow automatically retrie…
nddrylliog authored
97 rm -rf build/
3139e9f @duckinator Should make `make rescue` work almost universally.
duckinator authored
98 # Note: ./utils/downloader tries curl, ftp, and then wget.
99 # GNU ftp will _not_ work: it does not accept a url as an argument.
8a6120e @duckinator Who in the world thought preserving permissions for this was a good i…
duckinator authored
100 ./utils/downloader.sh http://www.fileville.net/ooc/bootstrap.tar.bz2 | tar xjvmf - 1>/dev/null
a56b5b7 @duckinator Split `make rescue` into 2 steps
duckinator authored
101 if [ ! -e build ]; then cp -rfv rock-*/build ./; fi
102
103 # Attempt to grab a rock bootstrap from Alpaca and recompile
7961049 @duckinator Make, I hate you. One day, you will die a painful death.
duckinator authored
104 rescue: download-bootstrap
105 $(MAKE) clean bootstrap
a134482 Added 'make rescue' target to Makefile, to allow automatically retrie…
nddrylliog authored
106
107 # Compile rock with the backup'd version of itself
184bb0e @nddrylliog 'make backup' to create a backup copy of the rock executable. 'make s…
nddrylliog authored
108 safe:
d15223e @fredreichbier Makefile: Use `$(MAKE)` instead of `make`, should fix make problems o…
fredreichbier authored
109 OOC=bin/safe_rock $(MAKE) self
184bb0e @nddrylliog 'make backup' to create a backup copy of the rock executable. 'make s…
nddrylliog authored
110
b7ed2d7 @duckinator Add `make VERSION=... bootstrap_tarball`
duckinator authored
111 bootstrap_tarball:
112 ifeq ($(VERSION),)
113 @echo "You must specify VERSION. Generates rock-VERSION-bootstrap-only.tar.bz2"
114 else
115 $(MAKE) prepare_bootstrap
8a6120e @duckinator Who in the world thought preserving permissions for this was a good i…
duckinator authored
116 tar cjvfm rock-${VERSION}-bootstrap-only.tar.bz2 build
b7ed2d7 @duckinator Add `make VERSION=... bootstrap_tarball`
duckinator authored
117 endif
118
a134482 Added 'make rescue' target to Makefile, to allow automatically retrie…
nddrylliog authored
119 # Clean all temporary files that may make a build fail
510ed5a @nddrylliog Remove dependency on nagaqueen in rock.use, removed rock.anjuta, more…
nddrylliog authored
120 clean:
9acab22 @nddrylliog Cleanups, improvements to slave mode / lib-caching, etc.
nddrylliog authored
121 rm -rf *_tmp/ .libs/
410f00f fixed make clean in makefile for make bootstrap, added a workaround f…
rofl0r authored
122 rm -rf `find build/ -name '*.o'`
Something went wrong with that request. Please try again.