hot warm cold (creation)

This commit is contained in:
Jean Sirmai 2024-04-27 16:16:21 +02:00
parent f10b52e7dd
commit 235d907e55
Signed by: jean
GPG Key ID: FB3115C340E057E3
9 changed files with 75 additions and 5 deletions

View File

@ -15,22 +15,64 @@ OPTIMIZE = -O2
all:
exec
exec.o:
$(CC) $(CFLAGS) $(WARNINGS) $(DEBUG) $(OPTIMIZE) warm.c -o $@ main.c
exec.o: hot.c warm.c cold.c main.c Makefile
$(CC) $(CFLAGS) $(WARNINGS) $(DEBUG) $(OPTIMIZE) hot.c warm.c cold.c -o $@ main.c
clean:
rm -f exec.o
# Builder will call this to install the application before running.
install:
echo "Installing is not supported"
run:
# Builder uses this target to run your application.
run: exec.o
./exec.o
#------------------------------------------------------------------------------#
# To study : can the following commands be removed ? #
#------------------------------------------------------------------------------#
#SHELL = /bin/sh
#.SUFFIXES:
#.SUFFIXES: .c .o .h # is .h useful ?
#.PHONY = run
#.PHONY = clean
#.PHONY: Makefile
#CC=gcc
#CFLAGS=`pkg-config --cflags gtk4 --libs gtk4`
#WARNINGS = -Wall
#DEBUG = -ggdb -fno-omit-frame-pointer
#OPTIMIZE = -O2
# in exec.o:
# $(CC) $(CFLAGS) $(WARNINGS) $(DEBUG) $(OPTIMIZE)
# après les $(...), dans : warm.c -o $@ main.c le $@ peut être supprimé
#all:
# exec
#install:
# echo "Installing is not supported"
#------------------------------------------------------------------------------#
# Personnal notes & links #
#------------------------------------------------------------------------------#
# gcc $( pkg-config --cflags gtk4 ) -o exec main.c $( pkg-config --libs gtk4 )
# https://www.gnu.org/software/make/manual/

4
cold.c Normal file
View File

@ -0,0 +1,4 @@
#include <stdio.h>
#include <gtk-4.0/gtk/gtk.h>
void print_text(GtkWidget *widget, gpointer data) {g_print (data);}

14
cold.h Normal file
View File

@ -0,0 +1,14 @@
#include <stdio.h>
#include <gtk/gtk.h>
void print_text(GtkWidget *widget, gpointer data);
/*
GtkWidget *button_0 = gtk_button_new_with_label ("Quit");
GtkWidget *button_1 = gtk_button_new_with_label ("I");
GtkWidget *button_2 = gtk_button_new_with_label ("II");
GtkWidget *button_3 = gtk_button_new_with_label ("III");
GtkWidget *button_4 = gtk_button_new_with_label ("IV");
GtkWidget *button_5 = gtk_button_new_with_label ("V");
*/
// GtkToggleButton *tb1 = GTK_TOGGLE_BUTTON (gtk_button_new_with_label ("tb1"));

BIN
exec.o

Binary file not shown.

4
hot.c Normal file
View File

@ -0,0 +1,4 @@
#include <stdio.h>
#include <gtk-4.0/gtk/gtk.h>

3
hot.h Normal file
View File

@ -0,0 +1,3 @@
#include <stdio.h>
#include <gtk-4.0/gtk/gtk.h>

2
main.c
View File

@ -1,5 +1,7 @@
#include <gtk/gtk.h>
#include "hot.h"
#include "warm.h"
#include "cold.h"
static void activate (GtkApplication *app, gpointer user_data) {
GtkWidget *button_0 = gtk_button_new_with_label ("Quit");

2
warm.c
View File

@ -12,4 +12,4 @@
// GtkToggleButton *tb1 = GTK_TOGGLE_BUTTON (gtk_button_new_with_label ("tb1"));
void print_text(GtkWidget *widget, gpointer data) {g_print (data);}

3
warm.h
View File

@ -13,6 +13,7 @@
#include <glib-2.0/glib.h>
#include <gtk-4.0/gtk/gtk.h>
/*
extern GtkWidget *button_0;
extern GtkWidget *button_1;
extern GtkWidget *button_2;
@ -21,4 +22,4 @@ extern GtkWidget *button_4;
extern GtkWidget *button_5;
void print_text(char *text);
*/