organized project directory. makefile broken
This commit is contained in:
@@ -7,27 +7,27 @@ ifeq ($(LDFLAGS),)
|
|||||||
LDFLAGS := -lwayland-client -lm
|
LDFLAGS := -lwayland-client -lm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIB_SRC := waymini.c xdg-shell-client-protocol.c
|
LIB_SRC := waymini/waymini.c waymini/xdg-shell-client-protocol.c
|
||||||
LIB_OBJ := $(LIB_SRC:.c=.o)
|
LIB_OBJ := $(LIB_SRC:.c=.o)
|
||||||
|
|
||||||
.PHONY: all clean
|
.PHONY: all clean
|
||||||
|
|
||||||
all: libwaymini.a example waymini
|
all: waymini/libwaymini.a example waymini
|
||||||
|
|
||||||
libwaymini.a: $(LIB_OBJ)
|
waymini/libwaymini.a: $(LIB_OBJ)
|
||||||
ar rcs $@ $^
|
ar rcs -rpath=./waymini $@ $^
|
||||||
|
|
||||||
example: example.cpp libwaymini.a
|
example: example.cpp waymini/libwaymini.a
|
||||||
g++ $(CFLAGS) -o $@ example.cpp -L. -lwaymini $(LDFLAGS)
|
g++ $(CFLAGS) -o $@ example.cpp -L. -lwaymini $(LDFLAGS)
|
||||||
|
|
||||||
waymini: waymini_standalone.c waymini.c xdg-shell-client-protocol.c
|
waymini: waymini/waymini_standalone.c waymini/waymini.c waymini/xdg-shell-client-protocol.c
|
||||||
$(CC) $(CFLAGS) -o $@ waymini_standalone.c waymini.c xdg-shell-client-protocol.c $(LDFLAGS)
|
$(CC) $(CFLAGS) -o $@ waymini/waymini_standalone.c waymini/waymini.c waymini/xdg-shell-client-protocol.c $(LDFLAGS)
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CFLAGS) -c -o $@ $<
|
$(CC) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(LIB_OBJ) libwaymini.a example waymini
|
rm -f $(LIB_OBJ) waymini/libwaymini.a example waymini/waymini
|
||||||
|
|
||||||
xdg-shell-client-protocol.c xdg-shell-client-protocol.h: gen-protocols.sh
|
xdg-shell-client-protocol.c xdg-shell-client-protocol.h: gen-protocols.sh
|
||||||
bash gen-protocols.sh
|
bash waymini/gen-protocols.sh
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
namespace UwU {
|
|
||||||
|
|
||||||
class Bresenham {
|
|
||||||
private:
|
|
||||||
int16_t x0;
|
|
||||||
int16_t y0;
|
|
||||||
int16_t x1;
|
|
||||||
int16_t y1;
|
|
||||||
int16_t d;
|
|
||||||
int16_t
|
|
||||||
|
|
||||||
public:
|
|
||||||
Bresenham(int16_t x0, int16_t y0, int16_t x1, int16_t y1) {
|
|
||||||
this->x0 = x0;
|
|
||||||
this->y0 = y0;
|
|
||||||
this->x1 = x1;
|
|
||||||
this->y1 = y1;
|
|
||||||
|
|
||||||
if (abs(y1 - y0) < abs(x1 - x0)) {
|
|
||||||
if (x0 > x1) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
+6
-6
@@ -1,6 +1,6 @@
|
|||||||
// #pragma once
|
// #pragma once
|
||||||
|
|
||||||
#include "waymini.h"
|
#include "waymini/waymini.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -9,13 +9,13 @@
|
|||||||
|
|
||||||
#include "datatypes.cpp"
|
#include "datatypes.cpp"
|
||||||
#include "helpers.cpp"
|
#include "helpers.cpp"
|
||||||
#include "triangle.cpp"
|
|
||||||
#include "buffer.cpp"
|
#include "buffer.cpp"
|
||||||
#include "surface.cpp"
|
#include "surface.cpp"
|
||||||
#include "trapezoid.cpp"
|
#include "primatives/line.cpp"
|
||||||
#include "line.cpp"
|
#include "primatives/point.cpp"
|
||||||
#include "rectangle.cpp"
|
#include "primatives/rectangle.cpp"
|
||||||
#include "point.cpp"
|
#include "primatives/trapezoid.cpp"
|
||||||
|
#include "primatives/triangle.cpp"
|
||||||
// #include "draw.cpp"
|
// #include "draw.cpp"
|
||||||
#include "shaders/shader.cpp"
|
#include "shaders/shader.cpp"
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "datatypes.cpp"
|
#include "../datatypes.cpp"
|
||||||
#include "helpers.cpp"
|
#include "../helpers.cpp"
|
||||||
#include "buffer.cpp"
|
#include "../buffer.cpp"
|
||||||
|
|
||||||
namespace UwU {
|
namespace UwU {
|
||||||
// line
|
// line
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "datatypes.cpp"
|
#include "../datatypes.cpp"
|
||||||
#include "helpers.cpp"
|
#include "../helpers.cpp"
|
||||||
#include "buffer.cpp"
|
#include "../buffer.cpp"
|
||||||
|
|
||||||
namespace UwU {
|
namespace UwU {
|
||||||
// point
|
// point
|
||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "datatypes.cpp"
|
#include "../datatypes.cpp"
|
||||||
#include "helpers.cpp"
|
#include "../helpers.cpp"
|
||||||
#include "buffer.cpp"
|
#include "../buffer.cpp"
|
||||||
#include "shaders/shader.cpp"
|
#include "../shaders/shader.cpp"
|
||||||
|
|
||||||
namespace UwU {
|
namespace UwU {
|
||||||
// rectangle
|
// rectangle
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "datatypes.cpp"
|
#include "../datatypes.cpp"
|
||||||
#include "helpers.cpp"
|
#include "../helpers.cpp"
|
||||||
#include "buffer.cpp"
|
#include "../buffer.cpp"
|
||||||
|
|
||||||
namespace UwU {
|
namespace UwU {
|
||||||
// trapezoid (horizontally constrained)
|
// trapezoid (horizontally constrained)
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "datatypes.cpp"
|
#include "../datatypes.cpp"
|
||||||
#include "helpers.cpp"
|
#include "../helpers.cpp"
|
||||||
#include "buffer.cpp"
|
#include "../buffer.cpp"
|
||||||
|
|
||||||
namespace UwU {
|
namespace UwU {
|
||||||
class Triangle {
|
class Triangle {
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "waymini.h"
|
#include "waymini/waymini.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user