Modular makefile
This commit is contained in:
parent
1b53c9f862
commit
f0fe616410
13
Makefile
13
Makefile
@ -1,5 +1,14 @@
|
|||||||
|
libs = -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lSDL2_image -lSDL2_ttf
|
||||||
|
includes = -I"C:\SDL2\x32\include"
|
||||||
|
compiler = gcc
|
||||||
|
warningLevel = -Wall
|
||||||
|
sources = *.c
|
||||||
|
linker = -L"C:\SDL2\x32\lib"
|
||||||
|
target = Asteroids.exe
|
||||||
|
args = -o
|
||||||
|
|
||||||
all:
|
all:
|
||||||
gcc -Wall -IC:\SDL2\x32\include *.c -LC:\SDL2\x32\lib -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lSDL2_image -lSDL2_ttf -o Asteroids.exe
|
$(compiler) $(warningLevel) $(includes) $(sources) $(linker) $(libs) $(args) $(target)
|
||||||
|
|
||||||
run:
|
run:
|
||||||
Asteroids.exe
|
$(target)
|
||||||
|
@ -25,7 +25,7 @@ typedef struct enemyStruct {
|
|||||||
Bullet * Bullets;
|
Bullet * Bullets;
|
||||||
} Enemy;
|
} Enemy;
|
||||||
|
|
||||||
typedef struct shipStruct{
|
typedef struct shipStruct {
|
||||||
bool TurnRightButtonPressed, TurnLeftButtonPressed, ForwardButtonPressed, ShootButtonPressed, IsDead;
|
bool TurnRightButtonPressed, TurnLeftButtonPressed, ForwardButtonPressed, ShootButtonPressed, IsDead;
|
||||||
double Rotation;
|
double Rotation;
|
||||||
Vector FacingDirection, Location, Momentum;
|
Vector FacingDirection, Location, Momentum;
|
||||||
|
2
main.c
2
main.c
@ -55,7 +55,7 @@ int main(int argc, char * args[]){
|
|||||||
case SDL_KEYDOWN:
|
case SDL_KEYDOWN:
|
||||||
if (event.key.keysym.scancode == SDL_SCANCODE_ESCAPE) running = false;
|
if (event.key.keysym.scancode == SDL_SCANCODE_ESCAPE) running = false;
|
||||||
break;
|
break;
|
||||||
case SDL_MouseButtonEvent:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
mousePress(event.button);
|
mousePress(event.button);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user