Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98605163
Makefile
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Jan 14, 19:26
Size
765 B
Mime Type
text/x-makefile
Expires
Thu, Jan 16, 19:26 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23604474
Attached To
R11821 phys-743-lecture
Makefile
View Options
CC = gcc
CFLAGS = -O3 -ftree-vectorize
LDFLAGS = -lm
all: code
# This make file cut the compilation in 3 phases only for the purpose to show the phases
# compilation : assembly to machine code
code.o: code.s
@echo ""; echo ""
@echo " >> $(CC) -c $(CFLAGS) $< -o $@"
@$(CC) -c $(CFLAGS) $< -o $@
@objdump -d $@
# compilation : code to assembly code
code.s: code.i
@echo ""; echo ""
@echo " >> $(CC) -S $(CFLAGS) $< -o $@"
@$(CC) -S $(CFLAGS) $< -o $@
@cat $@
# precompilation
code.i: code.c
@echo ""; echo ""
@echo " >> $(CC) -E $(CFLAGS) $< -o $@"
@$(CC) -E $(CFLAGS) $< -o $@
@tail -n 12 $@
# linking
code: code.o
@echo ""; echo ""
@echo " >> $(CC) $(LDFLAGS) code.o -o $@"
@$(CC) $(LDFLAGS) code.o -o $@
clean:
rm -f *.o code code.i code.s
Event Timeline
Log In to Comment