Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed Makefile and added backup one in case of accidental cmake

  • Loading branch information...
commit b83f6ae83d371f22726f3bd6a9f15f089b03807a 1 parent c7bdf8b
@niksaak authored
Showing with 38 additions and 2 deletions.
  1. +2 −2 Makefile
  2. +36 −0 Makefile.tame
View
4 Makefile
@@ -17,9 +17,9 @@ ifeq ($(BUILD), debug)
-Wl,-Bdynamic -lm $(SDL_LDFLAGS)
else ifeq ($(BUILD), release)
- CFLAGS += $(SDL_CFLAGS) -O3 -Wall -std=gnu11 -DDEBUG_MODE -Iinclude/
+ CFLAGS += $(SDL_CFLAGS) -O3 -Wall -std=gnu11 -Iinclude/ -DNDEBUG
LDFLAGS += -Wl,-Bstatic -lchipmunk -lSDL_gfx \
- -Wl,-Bdynamic $(SDL_LDFLAGS)
+ -Wl,-Bdynamic -lm $(SDL_LDFLAGS)
endif
.PHONY: all clean cleandist
View
36 Makefile.tame
@@ -0,0 +1,36 @@
+NAME := dame
+BUILD := debug
+
+BINDIR := bin/
+SRCDIR := src/
+EXE := $(BINDIR)$(NAME)
+
+SOURCES := $(shell find $(SRCDIR) -type f -name '*.c')
+OBJECTS = $(SOURCES:.c=.o)
+
+SDL_CFLAGS = $(shell sdl-config --cflags)
+SDL_LDFLAGS = $(shell sdl-config --libs)
+
+ifeq ($(BUILD), debug)
+ CFLAGS += $(SDL_CFLAGS) -g -O0 -Wall -std=gnu11 -DDEBUG_MODE -Iinclude/
+ LDFLAGS += -Wl,-Bstatic -Llib/ -lchipmunk -lSDL_gfx \
+ -Wl,-Bdynamic -lm $(SDL_LDFLAGS)
+
+else ifeq ($(BUILD), release)
+ CFLAGS += $(SDL_CFLAGS) -O3 -Wall -std=gnu11 -Iinclude/ -DNDEBUG
+ LDFLAGS += -Wl,-Bstatic -lchipmunk -lSDL_gfx \
+ -Wl,-Bdynamic -lm $(SDL_LDFLAGS)
+endif
+
+.PHONY: all clean cleandist
+
+all: $(EXE)
+
+$(EXE): $(OBJECTS)
+ $(CC) $? $(LDFLAGS) -o $@
+
+clean:
+ @- $(RM) -v $(OBJECTS)
+
+cleandist:
+ @- $(RM) -v $(EXE)
Please sign in to comment.
Something went wrong with that request. Please try again.