blasteroid | shooting game inherited from the classic arcade game | Game Engine library
kandi X-RAY | blasteroid Summary
kandi X-RAY | blasteroid Summary
Blasteroid is a shooting game inherited from the classic arcade game Asteroid. It is written in C with the Allegro 5.0 library. Tutorial & Manual for Allegro 5.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of blasteroid
blasteroid Key Features
blasteroid Examples and Code Snippets
Community Discussions
Trending Discussions on blasteroid
QUESTION
note: this is the final exercise in the Head First C book.
I have the following problem. I am trying to make a game using the allegro5.2 libraries. I want to use multiple .c files in order to organize everything neatly. However, I have problems compiling my programs using a makefile. I am trying to compile this easy program:
...ANSWER
Answered 2017-Jan-26 at 20:43something like the following makefile contents should do the job
Notes:
- header files are only needed during the compile step
- library files are only needed during the link step
- best to have the first 'target' be 'all' so the makefile can be successfully executed without have to include a 'Blasteroids' parameter
- having a 'target' 'clean' makes it easy to clear away the items that will be rebuilt
- any 'target' that does not produce a file of the same name should be listed in a '.PSEUDO' operator
- the linker processes the linker command line items in the order listed on the command line. Therefore, list the objects, then the directories, then the library 'short' names
- list the header files at the end of the compile command line
- use macros (like CC and RM) that contain the full path to the executables so the correct executable is used, other wise the first item found in the $PATH that matches the name will be used.
- $^ is a built in macro that expands to the recipe dependencies
- $< is a built in macro that expands to the first dependency
- $@ is a built in macro that expands to the recipe 'target'
- the
$(SRC:.c=?)
statements do character replacement on the extension of the file names contained in the$(SRC)
macro - the
%.o:%.c
recipe says for each source file to be compiled into a object file, use this recipe - the '-ggdb' is so the maximum debug information will be available to the 'gdb' debugger.
- this pattern of 'makefile' can be extensively used for other projects with only minor variations. For more flexibility could also insert a recipe for automatically generating the header file dependencies, so would not need to list them individually in the compile recipe, but for now, the following makefile contents will do what you are currently trying to perform
and now the makefile
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install blasteroid
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page