# $Id$ DIR := $(shell pwd) EXESRC := $(DIR)/src EXEINC := $(DIR)/include LIBSRC := $(DIR)/libOpenGUI/src LIBINC := $(DIR)/libOpenGUI/include LIBOBJ := $(DIR)/libOpenGUI/obj EXEOBJ := $(DIR)/libOpenGUI/obj BIN := $(DIR)/bin LIB := $(DIR)/lib CC := cc LIBCFLAGS := -g -I$(LIBINC) CFLAGS := -g -I$(EXEINC) LDFLAGS := LIBS := -lpthread ifeq ($(STATIC),YES) LDFLAGS += -static endif .PHONY: initrd all all: $(BIN)/og initrd: $(DIR)/initrd $(DIR)/initrd: $(BIN)/og $(LIB)/libOpenGUI.so cp $(BIN)/og root/bin/ cp $(LIB)/libOpenGUI.so root/lib/ cd root && find . | cpio -o -H newc > $@ $(LIB)/libOpenGUI.so: $(LIBOBJ)/Connect.o mkdir -p $(LIB) $(CC) -shared -o $@ $^ $(BIN)/og: $(EXEOBJ)/main.o $(EXEOBJ)/opengui_server.o $(EXEOBJ)/opengui_mouse.o $(EXEOBJ)/opengui_kbd.o mkdir -p $(BIN) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) $(EXEOBJ)/main.o: $(EXESRC)/main.c $(EXEINC)/opengui.h mkdir -p $(EXEOBJ) $(CC) $(CFLAGS) -c -o $@ $< $(EXEOBJ)/%.o: $(EXESRC)/%.c $(EXEINC)/%.h $(EXEINC)/opengui.h mkdir -p $(EXEOBJ) $(CC) $(CFLAGS) -c -o $@ $< $(LIBOBJ)/%.o: $(LIBSRC)/%.c $(LIBINC)/OpenGUI/%.h $(LIBINC)/OpenGUI.h mkdir -p $(LIBOBJ) $(CC) $(LIBCFLAGS) -c -o $@ $<