summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-06-26 21:29:22 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-06-26 21:29:22 +0300
commit4e6026b12eb00ea5bdd6dece2dfc97ffe8c2fc87 (patch)
tree2ea1bef8ce87d9f707635ee30c7353abbb120f2e
parentb0463b0063a141c9d077a713c45a6dca681e9017 (diff)
downloada3catragmx-4e6026b12eb00ea5bdd6dece2dfc97ffe8c2fc87.tar.gz
a3catragmx-4e6026b12eb00ea5bdd6dece2dfc97ffe8c2fc87.tar.bz2
a3catragmx-4e6026b12eb00ea5bdd6dece2dfc97ffe8c2fc87.zip
add: Makefile, context.h
Diffstat (limited to '')
-rw-r--r--Makefile45
-rw-r--r--include/context.h34
-rw-r--r--src/main.c10
3 files changed, 83 insertions, 6 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..252bf6d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,45 @@
+CC := /usr/bin/gcc
+CFLAGS = -Wall -Wpedantic -I$(INC_DIR)
+LDLIBS :=
+
+# DIRS
+BASE_DIR = $(pwd)
+SRC_DIR = src
+BIN_DIR = bin
+OBJ_DIR = obj
+#LIB_DIR := lib
+BUILD_DIR = build
+INC_DIR = include
+
+# TARGETS
+TARGET := $(BIN_DIR)/catragmx
+SOURCES := $(wildcard $(SRC_DIR)/*.c)
+OBJECTS := $(SOURCES:$(SRC_DIR)/%.c=$(BUILD_DIR)%.o)
+
+# ALL TARGET
+all: $(TARGET)
+
+# COMPILE MAIN TARGET
+$(TARGET): $(SOURCES) | $(BIN_DIR)
+ $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ $(LDLIBS)
+
+# COMPILE OBJECTS
+$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c | $(BUILD_DIR)
+ $(CC) $(CFLAGS) -c $< -o $@
+
+# MAKE DIRS
+$(BUILD_DIR):
+ mkdir -p $(BUILD_DIR)
+
+$(BIN_DIR):
+ mkdir -p $(BIN_DIR)
+
+# CLEAN
+clean:
+ rm -rf $(BIN_DIR)
+ rm -rf $(BUILD_DIR)
+
+distclean: clean
+ git submodule deinit --all -f
+
+.PHONY: all clean
diff --git a/include/context.h b/include/context.h
new file mode 100644
index 0000000..95580ee
--- /dev/null
+++ b/include/context.h
@@ -0,0 +1,34 @@
+#include <stdlib.h>
+
+typedef enum {
+ ATM_1,
+ ATM_2
+} ATM_MODEL;
+
+typedef struct {
+ float scope_angle;
+ float bullet_mass;
+ float bore_height;
+ float muzzle_vel;
+ float ballistic_coef;
+ size_t drag_model;
+ float twist_dir;
+} gun_config;
+
+typedef struct {
+ float termperature;
+ float bar_pressure;
+ float rel_humidity;
+ float wind_speed;
+ size_t wind_dir;
+ ATM_MODEL atmosphere_model;
+} atmo_context;
+
+typedef struct {
+ float target_speed;
+ float target_range;
+} target_context;
+
+typedef struct {
+ gun_config gun;
+} ATragMXSolution;
diff --git a/src/main.c b/src/main.c
index 7a6182c..01be95f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,10 +1,8 @@
#include <stdio.h>
#include <stdlib.h>
-typedef struct {
+#include "context.h"
-} gun_config;
-
-typedef struct {
- gun_config gun;
-} ATragMXSolution;
+int main(int argc, char** argv) {
+ printf("Hello, %s\n", argv[0]);
+}