3dscontroller-ng/PC/Makefile

39 lines
771 B
Makefile
Raw Normal View History

2014-12-05 20:03:50 +00:00
CC := gcc
2015-09-06 18:39:59 +01:00
LN := gcc
2014-12-05 20:03:50 +00:00
ODIR := build
SDIR := source
IDIR := include
LDIR := lib
CFLAGS := -I$(IDIR) -fms-extensions -O2 -Wall
2015-09-06 18:38:49 +01:00
LFLAGS := $(LDIR)/vJoyInterface.lib -lws2_32 -lGdi32 -lgdiplus -static-libgcc
2014-12-05 20:03:50 +00:00
CFILES := $(wildcard $(SDIR)/*.c)
2015-09-06 18:39:59 +01:00
OBJS := $(patsubst $(SDIR)/%.c, $(ODIR)/%.o, $(wildcard $(SDIR)/*.c))
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)
$(ODIR):
@mkdir $@
.PHONY: clean
clean:
rm -f $(TARGET) $(ODIR)/*.o