/Makefile (c2029f6871ff6141604ec2a2262266e15b27919a) (2517 bytes) (mode 100644) (type blob)
CFLAGS = -O3 -Wall -Wextra -std=c11 -MMD -Weverything
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
OBJS := token.yy.o grammar.tab.o misc.o main.o \
hashtable.o paramlist.o funcdecl.o typeandname.o
.PHONY: all release clean debug prof clean-release-files clean-prof-files clean-build-files
all: pjass
debug: CFLAGS = -w -g
debug: pjass
prof: CFLAGS = -w -pg
prof: pjass
-include $(OBJS:.o=.d)
pjass: $(OBJS)
$(CC) $(CFLAGS) $^ -o $@
main.o: main.c
$(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: clean-build-files clean-release-files clean-prof-files
clean-build-files:
rm -f grammar.tab.h grammar.tab.c token.yy.c token.yy.h \
$(OBJS) $(OBJS:.o=.d) \
pjass.exe pjass
clean-release-files:
rm -f pjass-git-*.zip
clean-prof-files:
rm -f tests/should-check/*-analysis.txt \
tests/should-fail/*-analysis.txt \
gmon.out
release: pjass-git-$(VERSION)-src.zip pjass-git-$(VERSION).zip
pjass-git-$(VERSION)-src.zip: grammar.y token.l misc.c misc.h Makefile notes.txt readme.txt
zip -q -r pjass-git-$(VERSION)-src.zip $^ tests/should-check/ tests/should-fail/
pjass-git-$(VERSION).zip: pjass
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)
should-check: $(SHOULD_CHECK)
map-scripts: $(MAP_SCRIPTS)
test: should-fail should-check map-scripts
print-test: pjass
@echo 'Testing... '
Mode |
Type |
Size |
Ref |
File |
100644 |
blob |
168 |
c1ca22975fdbd25aedc5c81f51b87f059bbc4140 |
.gitignore |
100644 |
blob |
2517 |
c2029f6871ff6141604ec2a2262266e15b27919a |
Makefile |
100644 |
blob |
391 |
1f49d20bfca22ddee132b62a37c103610d08e211 |
check.sh |
100644 |
blob |
251 |
77cc7498114662cff955ad94eb1b1809c89b2233 |
fail.sh |
100644 |
blob |
215 |
e2d0c0f230e4387accdf5037eca5ee512c90a8a0 |
funcdecl.c |
100644 |
blob |
236 |
99ca506caaa5e457089f7391b005351fe8a0f2de |
funcdecl.h |
100644 |
blob |
26156 |
a2c1f9bf730ff7c04d749ba3dae1d4f921b7c66d |
grammar.y |
100644 |
blob |
2635 |
6fd3bb88318b11382e1e853efb9eb80d1f4413c6 |
hashtable.c |
100644 |
blob |
430 |
905a180f67713aad61271f6cc099195ff4d82a1f |
hashtable.h |
100644 |
blob |
4642 |
b8a962ba3d310ba722618545c2308a38a48589e1 |
main.c |
100644 |
blob |
14458 |
f4721e475becad42db92127a2b256711c7515933 |
misc.c |
100644 |
blob |
2744 |
de716879b5a96d40169f5f8fdf3ff6dd68e9d87b |
misc.h |
100644 |
blob |
1302 |
13d65e05aca85cddd2f539b14d98cfbf1c622752 |
notes.txt |
100644 |
blob |
330 |
92a4597d6df5097c58649391541d54f06b3bda1b |
paramlist.c |
100644 |
blob |
256 |
bb253362ef26a0ea881856aebeb8503fb82646fb |
paramlist.h |
100644 |
blob |
764 |
270df8583e78c80f366a8ab431fab673d89446d5 |
readme.txt |
040000 |
tree |
- |
2f736e3985eab5b3c8ba4181754a986901e1a073 |
tests |
100644 |
blob |
5871 |
dd8455821811ca52a9aef65a01031ec1d196a111 |
token.l |
100644 |
blob |
1720 |
6cb071ecb4b14a156d31b873a76859e8328ff4d4 |
typeandname.c |
100644 |
blob |
845 |
58e1d731d067c711d3b0dc781ed2f7d2fc573ac0 |
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