Permalink
Browse files

Changing from Makefile to premake4.

I don't really know what I'm doing with premake4, but copying the
structure from another project with a little guess works seems to have
worked anyway.

To build now, you need premake4. Then you type:

premake4 <build-type>

To generate your build script. In my case, I'm using GNU Make, so I type:

premake4 gmake

It generates a Makefile for me so then I type:

make

It seems to do a much more robust job than I was previously doing with a
plain Makefile. :)
  • Loading branch information...
1 parent e460089 commit b657189d39286282cbead2054c7dd07d448eb030 @bambams committed Dec 15, 2010
Showing with 21 additions and 37 deletions.
  1. +2 −0 .gitignore
  2. +0 −37 Makefile
  3. +19 −0 premake4.lua
View
2 .gitignore
@@ -1,4 +1,6 @@
*.exe
*.o
+Makefile
+build
rot
View
37 Makefile
@@ -1,37 +0,0 @@
-BIN=rot
-INCDIR=include
-OBJDIR=obj
-SRCDIR=src
-
-CXX=g++
-CXX_CFLAGS=-I$(INCDIR)
-
-ifdef DEBUG
- CXX_CFLAGS += -g3
-endif
-
-.PHONY: clean default
-
-default: $(OBJDIR) $(BIN)
-
-$(OBJDIR):
- mkdir -p $@
-
-$(BIN): $(OBJDIR)/Cfg.o $(OBJDIR)/main.o $(OBJDIR)/Range.o $(OBJDIR)/RotCipher.o
- $(CXX) $(CXX_CFLAGS) -o $@ $?
-
-$(OBJDIR)/Cfg.o: $(SRCDIR)/Cfg.cpp $(INCDIR)/Cfg.hpp
- $(CXX) $(CXX_CFLAGS) -c -o $@ $<
-
-$(OBJDIR)/main.o: $(SRCDIR)/main.cpp
- $(CXX) $(CXX_CFLAGS) -c -o $@ $<
-
-$(OBJDIR)/Range.o: $(SRCDIR)/Range.cpp $(INCDIR)/Range.hpp
- $(CXX) $(CXX_CFLAGS) -c -o $@ $<
-
-$(OBJDIR)/RotCipher.o: $(SRCDIR)/RotCipher.cpp $(INCDIR)/RotCipher.hpp
- $(CXX) $(CXX_CFLAGS) -c -o $@ $<
-
-clean:
- rm -fR $(BIN) $(OBJDIR)
-
View
19 premake4.lua
@@ -0,0 +1,19 @@
+
+solution ("rot")
+ configurations { "Debug", "Release" }
+
+ project ("rot")
+ kind "ConsoleApp"
+ language "C++"
+ location "build"
+ files { "src/*.cpp" }
+ includedirs { "include" }
+
+ configuration "Debug"
+ defines { "DEBUG" }
+ flags { "Symbols" }
+
+ configuration "Release"
+ defines { "NDEBUG" }
+ flags { "Optimize" }
+

0 comments on commit b657189

Please sign in to comment.