2015-08-23 02:51:41 -04:00
|
|
|
CC=gcc
|
|
|
|
LD=$(CC)
|
|
|
|
|
2015-10-24 22:32:08 -04:00
|
|
|
UNAME := $(shell uname -s)
|
|
|
|
ifeq ($(UNAME), Linux)
|
|
|
|
HIDAPI_NAME=hidapi-hidraw
|
|
|
|
else
|
|
|
|
HIDAPI_NAME=hidapi
|
|
|
|
endif
|
|
|
|
|
2015-10-24 22:54:34 -04:00
|
|
|
|
|
|
|
ifeq ($(shell uname -o), Msys)
|
|
|
|
COMPAT_OBJS=sleep.o memmem.o
|
|
|
|
endif
|
|
|
|
|
2015-10-25 22:41:44 -04:00
|
|
|
CFLAGS=-Wall -g `pkg-config $(HIDAPI_NAME) --cflags` --std=c99
|
2015-10-24 22:32:08 -04:00
|
|
|
LDFLAGS=`pkg-config $(HIDAPI_NAME) --libs` -g
|
2015-10-24 22:16:25 -04:00
|
|
|
GTK_CFLAGS=`pkg-config --cflags gtk+-3.0 gmodule-2.0`
|
|
|
|
GTK_LDFLAGS=`pkg-config --libs gtk+-3.0 gmodule-2.0`
|
2015-08-23 02:51:41 -04:00
|
|
|
|
|
|
|
PREFIX=/usr/local
|
|
|
|
|
2015-11-03 09:23:09 -05:00
|
|
|
PROGS=gcn64ctl mempak_ls mempak_format mempak_extract_note mempak_insert_note mempak_rm mempak_convert gcn64ctl_gui
|
2015-10-25 22:41:44 -04:00
|
|
|
MEMPAKLIB_OBJS=mempak.o mempak_fs.o
|
2015-08-23 02:51:41 -04:00
|
|
|
|
|
|
|
.PHONY : clean install
|
|
|
|
|
2015-11-03 09:23:09 -05:00
|
|
|
all: $(PROGS)
|
2015-10-24 22:16:25 -04:00
|
|
|
|
2015-11-01 14:12:44 -05:00
|
|
|
gcn64ctl_gui: gcn64ctl_gui.o gcn64ctl_gui_mpkedit.o gcn64.o gcn64lib.o hexdump.o ihex.o mempak_gcn64usb.o $(COMPAT_OBJS) $(MEMPAKLIB_OBJS)
|
2015-10-24 22:54:34 -04:00
|
|
|
$(LD) $^ $(LDFLAGS) $(GTK_LDFLAGS) -o $@
|
2015-10-24 22:16:25 -04:00
|
|
|
|
2015-11-01 14:12:44 -05:00
|
|
|
gcn64ctl: main.o gcn64.o gcn64lib.o hexdump.o gc2n64_adapter.o ihex.o delay.o mempak_gcn64usb.o $(COMPAT_OBJS) $(MEMPAKLIB_OBJS)
|
2015-10-24 22:54:34 -04:00
|
|
|
$(LD) $^ $(LDFLAGS) -o $@
|
2015-10-24 22:16:25 -04:00
|
|
|
|
2015-10-26 00:42:13 -04:00
|
|
|
gcn64ctl_gui.o: gcn64ctl_gui.c gcn64ctl_gui.h
|
|
|
|
$(CC) $(CFLAGS) $(GTK_CFLAGS) -c $<
|
|
|
|
|
|
|
|
gcn64ctl_gui_mpkedit.o: gcn64ctl_gui_mpkedit.c gcn64ctl_gui_mpkedit.h
|
2015-10-24 22:16:25 -04:00
|
|
|
$(CC) $(CFLAGS) $(GTK_CFLAGS) -c $<
|
2015-08-23 02:51:41 -04:00
|
|
|
|
2015-10-25 22:41:44 -04:00
|
|
|
mempak_convert: mempak_convert.o $(MEMPAKLIB_OBJS)
|
|
|
|
$(LD) $^ $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
mempak_rm: mempak_rm.o $(MEMPAKLIB_OBJS)
|
|
|
|
$(LD) $^ $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
mempak_insert_note: mempak_insert_note.o $(MEMPAKLIB_OBJS)
|
|
|
|
$(LD) $^ $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
mempak_extract_note: mempak_extract_note.o $(MEMPAKLIB_OBJS)
|
|
|
|
$(LD) $^ $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
mempak_ls: mempak_ls.o $(MEMPAKLIB_OBJS)
|
|
|
|
$(LD) $^ $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
mempak_format: mempak_format.o $(MEMPAKLIB_OBJS)
|
|
|
|
$(LD) $^ $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
|
2015-08-23 02:51:41 -04:00
|
|
|
%.o: %.c %.h
|
|
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
|
|
|
|
clean:
|
2015-11-03 09:23:09 -05:00
|
|
|
rm -f *.o *.exe $(PROGS)
|
2015-08-23 02:51:41 -04:00
|
|
|
|
|
|
|
install:
|
|
|
|
@echo "Install not done yet. Sorry"
|
|
|
|
|