-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 73f8a77
Showing
3 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Linker output | ||
*.ilk | ||
*.map | ||
*.exp | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex | ||
|
||
# Debug files | ||
*.dSYM/ | ||
*.su | ||
*.idb | ||
*.pdb | ||
|
||
# Kernel Module Compile Results | ||
*.mod* | ||
*.cmd | ||
.tmp_versions/ | ||
modules.order | ||
Module.symvers | ||
Mkfile.old | ||
dkms.conf | ||
|
||
game |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# A simple Makefile for compiling small SDL projects | ||
|
||
# set the compiler | ||
CC := clang | ||
|
||
# set the compiler flags | ||
CFLAGS := `sdl2-config --libs --cflags` -ggdb3 -O0 --std=c99 -Wall -lSDL2_image -lm | ||
|
||
# add header files here | ||
HDRS := | ||
|
||
# add source files here | ||
SRCS := hello.c | ||
|
||
# generate names of object files | ||
OBJS := $(SRCS:.c=.o) | ||
|
||
# name of executable | ||
EXEC := game | ||
|
||
# default recipe | ||
all: $(EXEC) | ||
|
||
# recipe for building the final executable | ||
$(EXEC): $(OBJS) $(HDRS) Makefile | ||
$(CC) -o $@ $(OBJS) $(CFLAGS) | ||
|
||
# recipe for building object files | ||
#$(OBJS): $(@:.o=.c) $(HDRS) Makefile | ||
# $(CC) -o $@ $(@:.o=.c) -c $(CFLAGS) | ||
|
||
# recipe to clean the workspace | ||
clean: | ||
rm -f $(EXEC) $(OBJS) | ||
|
||
.PHONY: all clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <stdio.h> | ||
#include <SDL2/SDL.h> | ||
|
||
|
||
int main(void) { | ||
if (SDL_Init(SDL_INIT_VIDEO) != 0) { | ||
printf("error initializing SDL: %s\\n", SDL_GetError()); | ||
return 1; | ||
} | ||
|
||
printf("initialization successful!\n"); | ||
|
||
// clean up resources before exiting | ||
SDL_Quit(); | ||
} |