3dscontroller-ng/PC/Makefile

45 lines
965 B
Makefile
Raw Normal View History

2014-12-05 20:03:50 +00:00
CC := gcc
2014-12-25 10:39:06 +00:00
CP := g++
LN := g++
2014-12-05 20:03:50 +00:00
ODIR := build
SDIR := source
IDIR := include
LDIR := lib
CFLAGS := -I$(IDIR) -fms-extensions -O2 -Wall
2015-03-22 13:43:14 +00:00
LFLAGS := -L$(LDIR) -lvJoyInterface -lws2_32 -lGdi32 -lgdiplus -static-libgcc -static-libstdc++
2014-12-05 20:03:50 +00:00
CFILES := $(wildcard $(SDIR)/*.c)
2014-12-25 10:39:06 +00:00
CPPFILES := $(wildcard $(SDIR)/*.cpp)
2014-12-05 20:03:50 +00:00
OBJS := $(patsubst $(SDIR)/%.c, build/%.o, $(wildcard $(SDIR)/*.c))
2014-12-25 10:39:06 +00:00
OBJS += $(patsubst $(SDIR)/%.cpp, build/%.o, $(wildcard $(SDIR)/*.cpp))
2014-12-05 20:03:50 +00:00
PLATFORM = $(shell uname)
ifeq ($(findstring Linux,$(PLATFORM)),Linux)
2014-12-11 08:49:42 +00:00
TARGET=3DSController
2014-12-05 20:03:50 +00:00
endif
ifeq ($(findstring Darwin,$(PLATFORM)),Darwin)
2014-12-11 08:49:42 +00:00
TARGET=3DSController
2014-12-05 20:03:50 +00:00
endif
ifeq ($(findstring MINGW,$(PLATFORM)),MINGW)
2014-12-11 08:49:42 +00:00
TARGET=3DSController.exe
2014-12-05 20:03:50 +00:00
endif
$(TARGET): $(ODIR) $(OBJS)
2014-12-25 10:39:06 +00:00
$(LN) $(ODIR)/*.o -o $(TARGET) $(CFLAGS) $(LFLAGS)
2014-12-05 20:03:50 +00:00
$(ODIR)/%.o: $(SDIR)/%.c
$(CC) -c -o $@ $< $(CFLAGS)
2014-12-25 10:39:06 +00:00
$(ODIR)/%.o: $(SDIR)/%.cpp
$(CP) -c -o $@ $< $(CFLAGS)
2014-12-05 20:03:50 +00:00
$(ODIR):
@mkdir $@
.PHONY: clean
clean:
rm -f $(TARGET) $(ODIR)/*.o