/GNUmakefile (a62ad00cdae7cd8a72c80d1d6ce2796e53b6d58c) (3557 bytes) (mode 100644) (type blob)
CFLAGS += -MMD -g -w
VERSION := $(shell git rev-parse --short HEAD)
# when testing and releasing, we can't run both in parallel
# but we also don't want to test when we're just making the zip
# additionaly we want to test before we make any zip file
# so these rules depend on test just when we're both releasing and testing
ifneq (,$(findstring release,$(MAKECMDGOALS)))
ifneq (,$(findstring test,$(MAKECMDGOALS)))
pjass-git-$(VERSION).zip: | test
pjass-git-$(VERSION)-src.zip: | test
endif
endif
SRC := misc.c hashtable.c paramlist.c funcdecl.c typeandname.c blocks.c tree.c sstrhash.c
OBJS := $(SRC:.c=.o)
OBJS += main.o token.yy.o grammar.tab.o
.PHONY: all release clean prof
.PHONY: clean-release-files clean-prof-files clean-build-files
.PHONY: binary-release src-release
.PHONY: help
all: pjass
help:
@awk -F ':|##' \
'/^[^\t].+?:.*?##/ { \
printf "\033[36m%-20s\033[0m %s\n", $$1, $$NF \
}' $(MAKEFILE_LIST)
-include $(OBJS:.o=.d)
pjass: $(OBJS) ## Builds pjass
$(CC) $(CFLAGS) $^ -o $@
test: should-fail should-check map-scripts ## Runs all tests
release: src-release binary-release ## Builds a pjass release with src- and bin-zipballs
clean: clean-build-files clean-release-files clean-prof-files ## Cleans the whole project
prof: CFLAGS = -w -pg
prof: pjass ## Builds pjass with profiling support. You can run all tests with profiling enabled via `make PROF=1 test`
main.o: main.c token.yy.h grammar.tab.h
$(CC) $(CFLAGS) -c -o $@ $< -DVERSIONSTR="\"git-$(VERSION)\""
%.o: %.c %.h
$(CC) $(CFLAGS) -c -o $@ $<
token.yy.o: token.yy.c | grammar.tab.h
main.o: main.c | grammar.tab.h
# see token.l options block
%.yy.c %.yy.h: %.l
flex $<
%.tab.c %.tab.h: %.y
bison -d $<
clean-build-files: ## Cleans all build files
rm -f grammar.tab.h grammar.tab.c token.yy.c token.yy.h \
$(OBJS) $(OBJS:.o=.d) \
pjass pjass.exe
clean-release-files: ## Cleans all release zipballs
rm -f pjass-git-*.zip
clean-prof-files: ## Cleans all profiling files
rm -f tests/should-check/*-analysis.txt \
tests/should-fail/*-analysis.txt \
tests/map-scripts/*-analysis.txt \
gmon.out
pjass.exe: CFLAGS=-O3 -march=native
pjass.exe: CC=mingw32-gcc
pjass.exe: $(SRC) main.c token.yy.c grammar.tab.c
find $^ | awk '{ print "#include \"" $$1 "\""}' | $(CC) $(CFLAGS) -x c -o $@ - -DVERSIONSTR="\"git-$(VERSION)\"" -DPJASS_AMALGATION
src-release: pjass-git-$(VERSION)-src.zip ## Builds the source zipball
binary-release: pjass.exe pjass-git-$(VERSION).zip ## Builds the exe zipball
pjass-git-$(VERSION)-src.zip: main.c grammar.y token.l GNUmakefile readme.md AUTHORS LICENSE $(SRC:.c=.h) $(SRC)
zip -q -r pjass-git-$(VERSION)-src.zip $^ tests/should-check/ tests/should-fail/
pjass-git-$(VERSION).zip: pjass.exe
mingw32-strip pjass.exe
upx --best --ultra-brute pjass.exe > /dev/null
zip -q pjass-git-$(VERSION).zip pjass.exe
SHOULD_FAIL := $(wildcard tests/should-fail/*.j)
SHOULD_CHECK := $(wildcard tests/should-check/*.j)
MAP_SCRIPTS := $(wildcard tests/map-scripts/*.j)
.PHONY: test print-test should-check should-fail map-scripts
.PHONY: $(SHOULD_CHECK) $(SHOULD_FAIL) $(MAP_SCRIPTS)
$(MAP_SCRIPTS): pjass print-test
@MAPSCRIPT=1 ./check.sh $@
$(SHOULD_CHECK): pjass print-test
@./check.sh $@
$(SHOULD_FAIL): pjass print-test
@./fail.sh $@
should-fail: $(SHOULD_FAIL) ## Tests that should fail
should-check: $(SHOULD_CHECK) ## Tests that should check
map-scripts: $(MAP_SCRIPTS) ## Tests which are run with common.j and Blizzard.j
print-test: pjass
@echo 'Testing... '
Mode |
Type |
Size |
Ref |
File |
100644 |
blob |
170 |
28f83f8deb57bbc09c713a866975355fd9225827 |
.gitignore |
100644 |
blob |
48 |
3bfb16e6c32903fb8e4db429b412ee6e8ef23a14 |
AUTHORS |
100644 |
blob |
3557 |
a62ad00cdae7cd8a72c80d1d6ce2796e53b6d58c |
GNUmakefile |
100644 |
blob |
1313 |
4dc80d23e5c4804173171f9e03724a7d9fff66a1 |
LICENSE |
100644 |
blob |
1431 |
176e50b9b24ded89c009136a2386586cacd5fcd2 |
blocks.c |
100644 |
blob |
282 |
7e063255643b647d598dadd7832458b24af8999d |
blocks.h |
100755 |
blob |
428 |
cc6218cbb759cfd1deef9a20b246b8ed7697bd02 |
check.sh |
100755 |
blob |
273 |
b0e5e8c7418adb04f6a7d76e9c011b4ba4ef3092 |
fail.sh |
100644 |
blob |
266 |
88a7c9f4c9cfca968c1b863d4fd49131b5c2e175 |
funcdecl.c |
100644 |
blob |
276 |
f409be6b975f0a454de860058f1bf91849f1de96 |
funcdecl.h |
100644 |
blob |
22316 |
d468d760ea15a1302b551138f6f2e51bed797982 |
grammar.y |
100644 |
blob |
1684 |
3f87f5c4542560d5ded7bd36438657a5869771ca |
hashtable.c |
100644 |
blob |
501 |
2185dc1cb949f6fa3a1b0985b4caaf7769456156 |
hashtable.h |
100644 |
blob |
6470 |
e50f3c6407908ffbd851b8de72229baf649c3e64 |
main.c |
100644 |
blob |
24837 |
9de9d46a2eb5f8cc19b170d035009e064f9c1ca3 |
misc.c |
100644 |
blob |
4680 |
d0822164a1e66dfe614ebbfa8cb24bd904d4fe00 |
misc.h |
100644 |
blob |
330 |
92a4597d6df5097c58649391541d54f06b3bda1b |
paramlist.c |
100644 |
blob |
256 |
bb253362ef26a0ea881856aebeb8503fb82646fb |
paramlist.h |
100644 |
blob |
3680 |
0d3a55aa2bd7911e71390008b7723399c094eba1 |
readme.md |
100644 |
blob |
2419 |
2da92786104975ea22a86ebfa36e70351bd5503f |
sstrhash.c |
100644 |
blob |
142 |
554d4f7e4b94fb54dc58105adfc9cb4afac6887a |
sstrhash.h |
040000 |
tree |
- |
353c2b19d039ebd6ba45c6cfa887ee3975b60ace |
tests |
100644 |
blob |
6881 |
5b807517d3865b302cbde97aa949347c60a27a1d |
token.l |
100644 |
blob |
1286 |
ed7861c89f7b0a4a9654a970335e1dd4968c29ab |
tree.c |
100644 |
blob |
356 |
d943f2d407216cea33c9931439d6802af7d08ce6 |
tree.h |
100644 |
blob |
2502 |
fee7aee3384745b8f13f8b98870814cc109981b6 |
typeandname.c |
100644 |
blob |
914 |
c7c2ecbf5459c7cb80bd2661e6ca78c32a780e10 |
typeandname.h |
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"
Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/vrtc/pjass
Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/vrtc/pjass
Clone this repository using git:
git clone git://git.rocketgit.com/user/vrtc/pjass
You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a
merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main