1 # Makefile for xuni, Linux version
7 SRC_TARGETS
= all depend
clean wc
12 SUBDIRS
= $(DOC
) $(DIST
)
18 # Targets relating to executables
19 .PHONY
: run runa debug profile viewprofile
27 $(MAKE
) -C
$(SRC
) clean all \
28 '$(shell grep -E "CFLAGS\s?=" $(SRC)/Makefile) -pg'
30 tempfile
--directory .
--prefix prof-
--suffix .out
> profile.name
31 gprof
$(TARGET
) > $(shell cat profile.name
)
32 cp
$(TARGET
) $(TARGET
)_profile
33 $(MAKE
) -C
$(SRC
) clean
34 cp
$(TARGET
)_profile
$(TARGET
)
37 # kprof is started in a new terminal due to its excessive output
38 gnome-terminal
-x kprof
-f
$(shell cat profile.name
)
40 # Targets from and relating to src/
45 # Targets from and relating to other subdirectories
51 .PHONY
: memcheck permissions
53 valgrind
--leak-check
=full
--show-reachable
=yes
-v
$(TARGET
) 2>&1\
54 | tee valgrind.output | less
58 #for file in $(shell find); do \
59 # if [ -f "$$file" ]; then \
60 # if [ -n "$$(file $$file | grep executable)" ]; then \
61 # echo "chmod 755 $$file"; \
63 # echo "chmod 644 $$file"; \
65 # elif [ -d "$$file" ]; then \
66 # echo "chmod 755 $$file"; \
68 # echo "Ignoring $$file"; \
72 chmod
644 $(shell find
-type f
)
73 chmod
755 $(shell find
-type d
) $(TARGET
) $(TARGET
).exe