OS := $(shell uname -s) ifeq ($(OS), FreeBSD) CC=cc CFLAGS=-I/usr/local/include -I../../deps/ -I../../deps/ftplib-4.0-1/src LDFLAGS=-L/usr/local/lib endif ifeq ($(OS), DragonFly) CC=cc CFLAGS=-I/usr/local/include -I../../deps/ -I../../deps/ftplib-4.0-1/src LDFLAGS=-L/usr/local/lib endif ifeq ($(OS), NetBSD) CC=cc CFLAGS=-I/usr/local/include -I../../deps/ -I../../deps/ftplib-4.0-1/src LDFLAGS=-R/usr/pkg/lib -L/usr/pkg/lib endif ifeq ($(OS), OpenBSD) CC=cc CFLAGS=-I/usr/local/include -I../../deps/ -I../../deps/ftplib-4.0-1/src LDFLAGS=-L/usr/local/lib endif ifeq ($(OS), Linux) CC=gcc CFLAGS=-I/usr/local/include -I../../deps/ -I../../deps/ftplib-4.0-1/src LDFLAGS= endif ifeq ($(OS), Darwin) CC=cc CFLAGS=-I/usr/local/include -I../../deps/ -I../../deps/ftplib-4.0-1/src LDFLAGS= endif ifeq ($(OS), SunOS) CC=gcc CFLAGS=-I/usr/local/include -I../../deps/ -I../../deps/ftplib-4.0-1/src LDFLAGS=-lsocket -lnsl -lresolv endif DEPS = mnetftpc.c LIBFTP = ../../deps/ftplib-4.0-1/src/libftp.a OBJ = mnetftpc.o all: mnetftpc %.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) $(LIBFTP): cd ../../deps/ftplib-4.0-1/src && $(MAKE) libftp.a mnetftpc: $(OBJ) $(LIBFTP) $(CC) -o mnetftpc $^ -L/usr/local/lib $(LDFLAGS) .PHONY: clean clean: rm -f $(OBJ) mnetftpc