aboutsummaryrefslogtreecommitdiff
path: root/tools/smxlink/makefile
diff options
context:
space:
mode:
authorJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-04-06 10:11:07 +0800
committerJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-04-06 10:11:07 +0800
commitf3e040230772f978540a71aea43dfde200992922 (patch)
treebd8ca31b72dd01e24980b073854e263589530f56 /tools/smxlink/makefile
downloadpsn00bsdk-f3e040230772f978540a71aea43dfde200992922.tar.gz
First commit
Diffstat (limited to 'tools/smxlink/makefile')
-rw-r--r--tools/smxlink/makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/tools/smxlink/makefile b/tools/smxlink/makefile
new file mode 100644
index 0000000..b50fd26
--- /dev/null
+++ b/tools/smxlink/makefile
@@ -0,0 +1,42 @@
+TARGET := smxlink
+
+CPPFILES = main.cpp timreader.cpp
+CFLAGS = -O2
+LDFLAGS = -s
+
+LIBS = -ltinyxml2
+
+CC = gcc
+CXX = g++
+
+OFILES = $(addprefix build/,$(CPPFILES:.cpp=.o))
+
+ifeq "$(OS)" "Windows_NT"
+
+# Config for Windows
+INCLUDE = -I/c/tinyxml2
+LIBDIRS = -L/c/tinyxml2
+TARGET := $(TARGET).exe
+
+else
+
+# Config for anything else that isn't Windows
+EXE_SUFFIX =
+
+endif
+
+build/%.o: %.cpp
+ @mkdir -p $(dir $@)
+ $(CXX) $(CFLAGS) $(INCLUDE) -c $< -o $@
+
+all: $(OFILES)
+ $(CXX) $(CFLAGS) $(LDFLAGS) $(LIBDIRS) $(OFILES) $(LIBS) -o $(TARGET)
+
+install:
+ mkdir -p ../bin
+ cp $(TARGET) ../bin/$(TARGET)
+
+clean:
+ rm -Rf build $(TARGET)
+
+cleanall: clean